Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ai-infra-curriculum/ai-infra-engineer-learning
/ functions
Functions
523 in github.com/ai-infra-curriculum/ai-infra-engineer-learning
⨍
Functions
523
◇
Types & classes
113
↳
Endpoints
19
Method
predict_from_url
TODO: Download image from URL and run prediction Args: image_url: URL to image top_k: Number of top predicti
projects/project-101-basic-model-serving/src/model.py:304
Function
preprocess_and_engineer_features
TODO: Implement data preprocessing and feature engineering Steps: 1. Load validated raw data 2. Handle missing values (imputation, r
projects/project-102-mlops-pipeline/dags/data_pipeline.py:181
Function
preprocess_image
TODO: Implement image preprocessing Steps: 1. Convert bytes to PIL Image 2. Resize to model input size (e.g., 224x224) 3. Normal
projects/project-101-basic-model-serving/src/api.py:490
Function
preprocess_image
TODO: Preprocess image for model inference Steps to implement: 1. Convert PIL Image to numpy array 2. Normalize pixel values to [0,
projects/project-101-basic-model-serving/src/utils.py:182
Method
preprocess_image
TODO: Preprocess image bytes for model input Args: image_bytes: Raw image bytes (JPEG, PNG, etc.) Returns:
projects/project-101-basic-model-serving/src/model.py:181
Method
print_optimization_report
Generate a human-readable optimization report. Returns: Formatted report string TODO: Include: 1. Curre
projects/project-103-llm-deployment/src/llm/optimization.py:475
Method
process
Process documents through pipeline. TODO: Implement processing pipeline - Clean each document - Filter documents
projects/project-103-llm-deployment/src/ingestion/processor.py:503
Method
process_single
Process a single document. TODO: Implement single document processing - Clean content - Check if passes filter
projects/project-103-llm-deployment/src/ingestion/processor.py:542
Method
profile_inference
Profile LLM inference performance. Args: prompts: Test prompts for profiling engine: LLM engine instance
projects/project-103-llm-deployment/src/llm/optimization.py:262
Function
pull_model_from_mlflow_registry
TODO: Pull the latest Production model from MLflow Model Registry Steps: 1. Connect to MLflow Model Registry 2. Get latest Productio
projects/project-102-mlops-pipeline/dags/deployment_pipeline.py:109
Method
pull_model_from_registry
TODO: Pull model from MLflow Registry Steps: 1. Connect to MLflow 2. Get latest model in specified stage 3.
projects/project-102-mlops-pipeline/src/deployment/deploy.py:39
Method
query_with_history
Query with conversation context. Args: question: Current question conversation_id: Conversation identifier
projects/project-103-llm-deployment/src/rag/pipeline.py:436
Function
rag_generate
Generate answer using RAG (Retrieval-Augmented Generation). Args: request: RAG request with question api_key: API key
projects/project-103-llm-deployment/src/api/main.py:386
Function
readiness
Kubernetes readiness probe.
projects/project-102-mlops-pipeline/src/monitoring/health.py:414
Function
readiness_check
Readiness check endpoint. Different from health check - indicates if the service is ready to accept traffic (model loaded, warmup comple
projects/project-103-llm-deployment/src/api/main.py:253
Method
record_compute_cost
Record compute cost. TODO: Implement compute cost recording - Calculate cost - Create event - Update aggrega
projects/project-103-llm-deployment/src/monitoring/cost_tracker.py:372
Method
record_cost
Record and return cost. TODO: Implement cost recording - Calculate cost based on tokens - Increment cost counter
projects/project-103-llm-deployment/src/monitoring/metrics.py:237
Method
record_dag_complete
Record DAG run completion. Args: dag_id: Airflow DAG ID run_id: Airflow run ID duration_seconds:
projects/project-102-mlops-pipeline/src/monitoring/metrics.py:307
Method
record_dag_start
Record DAG run start. Args: dag_id: Airflow DAG ID run_id: Airflow run ID scheduled_time: Schedu
projects/project-102-mlops-pipeline/src/monitoring/metrics.py:289
Method
record_data_drift
Record data drift detection results. Args: dataset_name: Name of the dataset feature_name: Name of the featu
projects/project-102-mlops-pipeline/src/monitoring/metrics.py:237
Method
record_error
Record an error. TODO: Implement error recording - Increment error counter - Label with model, error type A
projects/project-103-llm-deployment/src/monitoring/metrics.py:274
Method
record_latency
Record request latency. TODO: Implement latency recording - Observe duration in histogram - Label with model, endpoi
projects/project-103-llm-deployment/src/monitoring/metrics.py:182
Method
record_model_evaluation
Record model evaluation metrics. Args: model_name: Name of the model version: Model version eval
projects/project-102-mlops-pipeline/src/monitoring/metrics.py:127
Method
record_request
Record a completed request. TODO: Implement request recording - Increment request counter - Label with model, endpoi
projects/project-103-llm-deployment/src/monitoring/metrics.py:157
Method
record_request_cost
Record cost for a request. TODO: Implement request cost recording - Calculate cost - Create cost event - Upd
projects/project-103-llm-deployment/src/monitoring/cost_tracker.py:316
Method
record_resource_usage
Record resource usage during pipeline execution. Args: dag_id: Airflow DAG ID task_id: Airflow task ID
projects/project-102-mlops-pipeline/src/monitoring/metrics.py:366
Method
record_schema_validation
Record schema validation results. Args: dataset_name: Name of the dataset expected_schema: Expected schema d
projects/project-102-mlops-pipeline/src/monitoring/metrics.py:211
Method
record_task_execution
Record individual task execution. Args: dag_id: Airflow DAG ID task_id: Airflow task ID duration
projects/project-102-mlops-pipeline/src/monitoring/metrics.py:338
Method
record_tokens
Record token usage. TODO: Implement token recording - Increment input token counter - Increment output token counter
projects/project-103-llm-deployment/src/monitoring/metrics.py:206
Method
record_training_complete
Record successful training completion. Args: model_name: Name of the trained model version: Model version
projects/project-102-mlops-pipeline/src/monitoring/metrics.py:71
Method
record_training_failure
Record training failure. Args: model_name: Name of the model version: Model version error_type:
projects/project-102-mlops-pipeline/src/monitoring/metrics.py:102
Method
record_training_start
Record start of model training. Args: model_name: Name of the model being trained version: Model version
projects/project-102-mlops-pipeline/src/monitoring/metrics.py:53
Method
record_validation_result
Record data validation results. Args: dataset_name: Name of the dataset validated validation_suite: Name of
projects/project-102-mlops-pipeline/src/monitoring/metrics.py:182
Function
remove_html_tags
Remove HTML tags from text. TODO: Implement HTML tag removal - Use regex or parser - Preserve text content - Handle nested tags
projects/project-103-llm-deployment/src/ingestion/processor.py:579
Function
resize_image
TODO: Resize image while maintaining aspect ratio Steps to implement: 1. Calculate aspect ratio 2. Resize to target size (with paddi
projects/project-101-basic-model-serving/src/utils.py:154
Method
retrieve
Retrieve relevant documents for a query. Args: query: Search query top_k: Number of results to return
projects/project-103-llm-deployment/src/rag/retriever.py:61
Method
retrieve
Retrieve documents using vector similarity search. Args: query: Search query text top_k: Number of results t
projects/project-103-llm-deployment/src/rag/retriever.py:123
Method
retrieve
Perform hybrid retrieval. Args: query: Search query top_k: Number of results filters: Metadata f
projects/project-103-llm-deployment/src/rag/retriever.py:265
Method
retrieve
Retrieve and rerank documents. Args: query: Search query top_k: Final number of results filters:
projects/project-103-llm-deployment/src/rag/retriever.py:371
Method
retrieve
Generate query variations and aggregate results. Args: query: Original search query top_k: Number of results
projects/project-103-llm-deployment/src/rag/retriever.py:473
Method
rollback
TODO: Rollback to previous deployment
projects/project-102-mlops-pipeline/src/deployment/deploy.py:80
Function
rollback_deployment
TODO: Rollback deployment to previous version Steps: 1. Get previous deployment revision 2. Execute rollback using kubectl or K8s AP
projects/project-102-mlops-pipeline/dags/deployment_pipeline.py:561
Function
root
Root endpoint. Returns basic API information.
projects/project-103-llm-deployment/src/api/main.py:208
Function
root
Root endpoint - API information TODO: Return API information Should include: - API name - Version - Status - Documentat
projects/project-101-basic-model-serving/src/api.py:277
Method
run_continuous_health_checks
Run continuous health checks at specified interval. Args: interval_seconds: Interval between health checks TODO
projects/project-102-mlops-pipeline/src/monitoring/health.py:344
Method
run_validation
TODO: Run complete validation suite Steps: 1. Run schema validation 2. Run completeness checks 3. Run range
projects/project-102-mlops-pipeline/src/data/validation.py:414
Function
safe_stream_wrapper
Wrap stream with error handling and recovery. TODO: Implement safe streaming wrapper - Catch exceptions from generator - Send error
projects/project-103-llm-deployment/src/api/streaming.py:396
Function
sample_chunks
Sample text chunks for testing. TODO: Implement sample chunks - Create list of text chunks - Simulate chunking output Returns:
projects/project-103-llm-deployment/tests/conftest.py:218
Function
sample_documents
Sample documents for testing. TODO: Implement sample documents - Create list of test documents - Include various content types -
projects/project-103-llm-deployment/tests/conftest.py:177
Function
sample_embeddings
Sample embeddings for testing. TODO: Implement sample embeddings - Create dummy embedding vectors - Match expected dimension Re
projects/project-103-llm-deployment/tests/conftest.py:248
Function
sample_generate_request
Sample generation request. TODO: Implement sample request - Create GenerateRequest object - Use realistic parameters Returns:
projects/project-103-llm-deployment/tests/conftest.py:274
Function
sample_image
TODO: Create sample PIL Image Returns: PIL Image (RGB, 224x224) Example implementation: return Image.new('RGB', (224, 2
projects/project-101-basic-model-serving/tests/test_model.py:73
Function
sample_image
TODO: Create sample test image Steps to implement: 1. Create a simple PIL Image (RGB) 2. Save to BytesIO 3. Return image bytes
projects/project-101-basic-model-serving/tests/test_api.py:90
Function
sample_rag_request
Sample RAG request. TODO: Implement sample RAG request - Create RAGGenerateRequest object - Include retrieval parameters Return
projects/project-103-llm-deployment/tests/conftest.py:300
Function
sample_tensor
TODO: Create sample input tensor Returns: PyTorch tensor with shape (1, 3, 224, 224) Example implementation: return tor
projects/project-101-basic-model-serving/tests/test_model.py:58
Method
save_artifacts
TODO: Save preprocessing artifacts (pipelines, encoders, scalers) Steps: 1. Create output directory 2. Save pipeline
projects/project-102-mlops-pipeline/src/data/preprocessing.py:463
Function
save_experiment_results
Save experiment results to file. Args: experiment_name: Name of experiment results: Results dictionary output_dir: O
projects/project-103-llm-deployment/notebooks/utils.py:365
Method
save_model
TODO: Save trained model to disk Args: output_path: Path to save model
projects/project-102-mlops-pipeline/src/training/train.py:464
Method
scale_numerical_features
TODO: Scale numerical features Steps: 1. Identify numerical columns 2. Apply scaling strategy 3. Save scaler
projects/project-102-mlops-pipeline/src/data/preprocessing.py:225
Function
send_deployment_success_notification
TODO: Send success notification for deployment Information to include: - Model version deployed - Deployment timestamp - Health
projects/project-102-mlops-pipeline/dags/deployment_pipeline.py:629
Function
send_rollback_notification
TODO: Send notification about deployment rollback Returns: bool: True if notification sent
projects/project-102-mlops-pipeline/dags/deployment_pipeline.py:681
Function
send_success_notification
TODO: Implement success notification (Slack, Email, etc.) Steps: 1. Gather pipeline execution summary 2. Format notification message
projects/project-102-mlops-pipeline/dags/data_pipeline.py:322
Method
set
TODO: Set value in cache
projects/project-101-basic-model-serving/src/utils.py:602
Method
setUp
Create test data
projects/project-102-mlops-pipeline/tests/test_training.py:31
Method
setUp
Set up test fixtures
projects/project-102-mlops-pipeline/tests/test_data.py:38
Method
set_active_requests
Set number of active requests. TODO: Implement active request tracking - Set gauge to current count Args:
projects/project-103-llm-deployment/src/monitoring/metrics.py:327
Function
setup_cors
Configure CORS middleware. TODO: Implement CORS setup - Allow specified origins - Configure allowed methods - Set allowed header
projects/project-103-llm-deployment/src/api/middleware.py:556
Method
setup_expectations
TODO: Setup Great Expectations suite Steps: 1. Initialize Great Expectations context 2. Create or load expectation s
projects/project-102-mlops-pipeline/src/data/validation.py:54
Function
setup_logging
TODO: Setup logging configuration Steps to implement: 1. Create logger instance 2. Set log level (DEBUG, INFO, WARNING, ERROR) 3
projects/project-101-basic-model-serving/src/utils.py:32
Method
setup_mlflow
TODO: Setup MLflow tracking Steps: 1. Set MLflow tracking URI 2. Create or get experiment 3. Enable autologg
projects/project-102-mlops-pipeline/src/training/train.py:53
Method
shutdown
Gracefully shutdown the LLM server. TODO: Implement cleanup: 1. Cancel any pending requests 2. Flush GPU memory
projects/project-103-llm-deployment/src/llm/server.py:326
Function
shutdown_event
TODO: Cleanup on application shutdown Tasks: - Log shutdown message - Clean up model resources if needed - Close any open connec
projects/project-101-basic-model-serving/src/api.py:211
Method
size
TODO: Get current cache size
projects/project-101-basic-model-serving/src/utils.py:612
Function
skip_model_registration
Skip model registration and log reason
projects/project-102-mlops-pipeline/dags/training_pipeline.py:347
Method
start
Start metrics HTTP server. TODO: 1. Start Prometheus HTTP server 2. Log server start 3. Verify metrics endpo
projects/project-102-mlops-pipeline/src/monitoring/metrics.py:421
Method
start_monitoring
Start continuous GPU monitoring. TODO: Implement continuous monitoring - Run update loop - Sleep between updates
projects/project-103-llm-deployment/src/monitoring/metrics.py:557
Function
startup_event
TODO: Load ML model at application startup Steps to implement: 1. Log startup message 2. Load model from disk or model registry
projects/project-101-basic-model-serving/src/api.py:173
Method
stop
Stop metrics HTTP server. TODO: 1. Gracefully shutdown server 2. Flush any pending metrics 3. Log shutdown
projects/project-102-mlops-pipeline/src/monitoring/metrics.py:435
Function
stream_batch_responses
Stream multiple requests concurrently. TODO: Implement batch streaming - Process multiple requests in parallel - Multiplex results i
projects/project-103-llm-deployment/src/api/streaming.py:356
Function
stream_llm_response
Stream LLM tokens as SSE events. This wraps the raw LLM generator and formats output as SSE. TODO: Implement streaming wrapper - It
projects/project-103-llm-deployment/src/api/streaming.py:130
Function
stream_rag_response
Stream RAG-augmented generation. This performs retrieval first, then streams generation. TODO: Implement RAG streaming - Send "retr
projects/project-103-llm-deployment/src/api/streaming.py:211
Function
stream_with_heartbeat
Wrap generator with heartbeat events. Sends periodic heartbeat events to keep connection alive. Useful for preventing timeouts during sl
projects/project-103-llm-deployment/src/api/streaming.py:309
Method
tearDown
Clean up after tests
projects/project-102-mlops-pipeline/tests/test_data.py:73
Function
temp_dir
Create temporary directory with files. TODO: Implement temp directory fixture - Create directory structure - Add sample files -
projects/project-103-llm-deployment/tests/conftest.py:393
Function
temp_file
Create temporary file for testing. TODO: Implement temp file fixture - Create temp file with content - Return path - Auto-cleanu
projects/project-103-llm-deployment/tests/conftest.py:369
Function
test_404_for_nonexistent_endpoint
TODO: Test 404 response for non-existent endpoint Example implementation: response = client.get("/nonexistent") assert respo
projects/project-101-basic-model-serving/tests/test_api.py:425
Method
test_authentication
TODO: Test API key auth - Request without key - Verify 401 response - Test with valid key
projects/project-103-llm-deployment/tests/test_api.py:75
Method
test_batch_embeddings
TODO: Test batch embedding - Generate batch embeddings - Verify efficiency - Check all embeddings
projects/project-103-llm-deployment/tests/test_rag.py:49
Method
test_batch_generation
TODO: Test batch processing - Generate multiple completions - Verify batch efficiency - Check all outputs
projects/project-103-llm-deployment/tests/test_llm.py:49
Method
test_batch_indexing
TODO: Test batch indexing - Index documents - Verify upsert called - Check statistics
projects/project-103-llm-deployment/tests/test_ingestion.py:89
Function
test_batch_inference
TODO: Test batch inference Steps to test: 1. Create batch of images 2. Run batch inference 3. Assert correct number of predictio
projects/project-101-basic-model-serving/tests/test_model.py:438
Function
test_batch_inference_performance
TODO: Test that batch inference is faster than sequential Steps to test: 1. Create batch of images 2. Time batch inference 3. Ti
projects/project-101-basic-model-serving/tests/test_model.py:461
Method
test_categorical_encoding
TODO: Test categorical encoding
projects/project-102-mlops-pipeline/tests/test_data.py:122
Method
test_classification_evaluation
TODO: Test classification evaluation
projects/project-102-mlops-pipeline/tests/test_training.py:61
Function
test_client
FastAPI test client. TODO: Implement test client - Create FastAPI app instance - Add test routes - Return TestClient Return
projects/project-103-llm-deployment/tests/conftest.py:427
Method
test_completeness_validation
TODO: Test completeness checks
projects/project-102-mlops-pipeline/tests/test_data.py:95
Function
test_concurrent_predictions
TODO: Test handling concurrent prediction requests Steps to test: 1. Send multiple prediction requests concurrently 2. Assert all re
projects/project-101-basic-model-serving/tests/test_api.py:580
Method
test_continuous_batching
TODO: Test continuous batching - Process requests with batching - Verify throughput improvement - Check latency accep
projects/project-103-llm-deployment/tests/test_llm.py:71
Method
test_csv_data_source_fetch
TODO: Test CSV data fetching
projects/project-102-mlops-pipeline/tests/test_data.py:43
Method
test_database_source_with_mock
TODO: Test database source with mocked connection
projects/project-102-mlops-pipeline/tests/test_data.py:64
← previous
next →
301–400 of 523, ranked by callers