MCPcopy Create free account

hub / github.com/ai-infra-curriculum/ai-infra-engineer-learning / functions

Functions523 in github.com/ai-infra-curriculum/ai-infra-engineer-learning

Methodpredict_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
Functionpreprocess_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
Functionpreprocess_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
Functionpreprocess_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
Methodpreprocess_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
Methodprint_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
Methodprocess
Process documents through pipeline. TODO: Implement processing pipeline - Clean each document - Filter documents
projects/project-103-llm-deployment/src/ingestion/processor.py:503
Methodprocess_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
Methodprofile_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
Functionpull_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
Methodpull_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
Methodquery_with_history
Query with conversation context. Args: question: Current question conversation_id: Conversation identifier
projects/project-103-llm-deployment/src/rag/pipeline.py:436
Functionrag_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
Functionreadiness
Kubernetes readiness probe.
projects/project-102-mlops-pipeline/src/monitoring/health.py:414
Functionreadiness_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
Methodrecord_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
Methodrecord_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
Methodrecord_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
Methodrecord_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
Methodrecord_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
Methodrecord_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
Methodrecord_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
Methodrecord_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
Methodrecord_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
Methodrecord_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
Methodrecord_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
Methodrecord_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
Methodrecord_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
Methodrecord_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
Methodrecord_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
Methodrecord_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
Methodrecord_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
Methodrecord_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
Functionremove_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
Functionresize_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
Methodretrieve
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
Methodretrieve
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
Methodretrieve
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
Methodretrieve
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
Methodretrieve
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
Methodrollback
TODO: Rollback to previous deployment
projects/project-102-mlops-pipeline/src/deployment/deploy.py:80
Functionrollback_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
Functionroot
Root endpoint. Returns basic API information.
projects/project-103-llm-deployment/src/api/main.py:208
Functionroot
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
Methodrun_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
Methodrun_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
Functionsafe_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
Functionsample_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
Functionsample_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
Functionsample_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
Functionsample_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
Functionsample_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
Functionsample_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
Functionsample_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
Functionsample_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
Methodsave_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
Functionsave_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
Methodsave_model
TODO: Save trained model to disk Args: output_path: Path to save model
projects/project-102-mlops-pipeline/src/training/train.py:464
Methodscale_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
Functionsend_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
Functionsend_rollback_notification
TODO: Send notification about deployment rollback Returns: bool: True if notification sent
projects/project-102-mlops-pipeline/dags/deployment_pipeline.py:681
Functionsend_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
Methodset
TODO: Set value in cache
projects/project-101-basic-model-serving/src/utils.py:602
MethodsetUp
Create test data
projects/project-102-mlops-pipeline/tests/test_training.py:31
MethodsetUp
Set up test fixtures
projects/project-102-mlops-pipeline/tests/test_data.py:38
Methodset_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
Functionsetup_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
Methodsetup_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
Functionsetup_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
Methodsetup_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
Methodshutdown
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
Functionshutdown_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
Methodsize
TODO: Get current cache size
projects/project-101-basic-model-serving/src/utils.py:612
Functionskip_model_registration
Skip model registration and log reason
projects/project-102-mlops-pipeline/dags/training_pipeline.py:347
Methodstart
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
Methodstart_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
Functionstartup_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
Methodstop
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
Functionstream_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
Functionstream_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
Functionstream_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
Functionstream_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
MethodtearDown
Clean up after tests
projects/project-102-mlops-pipeline/tests/test_data.py:73
Functiontemp_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
Functiontemp_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
Functiontest_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
Methodtest_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
Methodtest_batch_embeddings
TODO: Test batch embedding - Generate batch embeddings - Verify efficiency - Check all embeddings
projects/project-103-llm-deployment/tests/test_rag.py:49
Methodtest_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
Methodtest_batch_indexing
TODO: Test batch indexing - Index documents - Verify upsert called - Check statistics
projects/project-103-llm-deployment/tests/test_ingestion.py:89
Functiontest_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
Functiontest_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
Methodtest_categorical_encoding
TODO: Test categorical encoding
projects/project-102-mlops-pipeline/tests/test_data.py:122
Methodtest_classification_evaluation
TODO: Test classification evaluation
projects/project-102-mlops-pipeline/tests/test_training.py:61
Functiontest_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
Methodtest_completeness_validation
TODO: Test completeness checks
projects/project-102-mlops-pipeline/tests/test_data.py:95
Functiontest_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
Methodtest_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
Methodtest_csv_data_source_fetch
TODO: Test CSV data fetching
projects/project-102-mlops-pipeline/tests/test_data.py:43
Methodtest_database_source_with_mock
TODO: Test database source with mocked connection
projects/project-102-mlops-pipeline/tests/test_data.py:64
← previousnext →301–400 of 523, ranked by callers