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

Methodencode_query
Encode a search query. Some embedding models have separate instructions for queries vs documents. Args: query:
projects/project-103-llm-deployment/src/rag/embeddings.py:186
Methodengineer_features
TODO: Create engineered features Steps: 1. Create interaction features (e.g., feature1 * feature2) 2. Create polynom
projects/project-102-mlops-pipeline/src/data/preprocessing.py:293
Methodenrich
Add enriched metadata to document. TODO: Implement metadata enrichment - Extract keywords - Calculate statistics
projects/project-103-llm-deployment/src/ingestion/processor.py:379
Functionestimate_cost
Estimate generation cost in USD. TODO: Implement cost estimation - Define cost per token for different models - Calculate total cost
projects/project-103-llm-deployment/src/api/models.py:492
Functionestimate_gpu_memory_requirement
Estimate GPU memory requirement for a model. Args: model_name: Hugging Face model name quantization: Quantization method (aw
projects/project-103-llm-deployment/src/llm/server.py:423
Methodestimate_kv_cache_memory
Estimate KV cache memory usage. Args: num_tokens: Number of tokens in sequence batch_size: Number of sequenc
projects/project-103-llm-deployment/src/llm/optimization.py:234
Methodestimate_memory_usage
Estimate GPU memory usage for this configuration. Returns: Estimated memory in GB TODO: Implement estimation:
projects/project-103-llm-deployment/src/llm/config.py:321
Methodestimate_monthly_cost
Estimate monthly costs. TODO: Implement monthly cost estimation - Calculate token costs - Calculate compute costs
projects/project-103-llm-deployment/src/monitoring/cost_tracker.py:223
Functionestimate_optimal_chunk_size
Estimate optimal chunk size for a document collection. Args: documents: Sample documents embedding_model: Embedding model
projects/project-103-llm-deployment/src/rag/chunking.py:406
Methodevaluate_classification
TODO: Evaluate classification model Steps: 1. Generate predictions 2. Calculate metrics (accuracy, precision, recall
projects/project-102-mlops-pipeline/src/training/evaluate.py:42
Functionevaluate_embedding_quality
Evaluate embedding model quality using test queries. Args: test_queries: List of test queries expected_similar: List of expe
projects/project-103-llm-deployment/notebooks/utils.py:125
Functionevaluate_model_performance
TODO: Comprehensive model evaluation Steps: 1. Load trained model 2. Evaluate on test set 3. Calculate multiple metrics 4. G
projects/project-102-mlops-pipeline/dags/training_pipeline.py:189
Methodevaluate_regression
TODO: Evaluate regression model Calculate MSE, RMSE, MAE, R2 score Create residual plots
projects/project-102-mlops-pipeline/src/training/evaluate.py:105
Functionevent_loop
Create event loop for async tests. TODO: Implement event loop fixture - Create new event loop - Yield for tests - Close after se
projects/project-103-llm-deployment/tests/conftest.py:34
Methodexport_to_json
Export cost data to JSON. TODO: Implement JSON export - Serialize events - Write to file - Include metadata
projects/project-103-llm-deployment/src/monitoring/cost_tracker.py:466
Functionextract_code_blocks
Extract code blocks from markdown. TODO: Implement code block extraction - Find ```...``` blocks - Preserve code content - Retur
projects/project-103-llm-deployment/src/ingestion/processor.py:601
Methodfetch_data
TODO: Fetch data from source Args: **kwargs: Source-specific parameters (query, date range, filters, etc.) Retu
projects/project-102-mlops-pipeline/src/data/ingestion.py:65
Methodfetch_data
TODO: Read CSV file into DataFrame Steps: 1. Determine if local or remote file 2. Read CSV with appropriate paramete
projects/project-102-mlops-pipeline/src/data/ingestion.py:119
Methodfetch_data
TODO: Fetch data from database Steps: 1. Construct or validate SQL query 2. Add incremental loading logic if specifi
projects/project-102-mlops-pipeline/src/data/ingestion.py:195
Methodfetch_data
TODO: Fetch data from REST API Steps: 1. Construct full URL 2. Add authentication 3. Handle pagination (if A
projects/project-102-mlops-pipeline/src/data/ingestion.py:298
Methodfilter
Filter documents. TODO: Implement filtering pipeline - Filter by length - Filter by language - Remove duplic
projects/project-103-llm-deployment/src/ingestion/processor.py:234
Methodfit_transform
TODO: Fit preprocessing pipeline and transform data Args: df: Training data Returns: pd.DataFrame:
projects/project-102-mlops-pipeline/src/data/preprocessing.py:437
Methodflush
Flush buffer contents. TODO: Implement flush - Return all buffered tokens - Clear buffer
projects/project-103-llm-deployment/src/api/streaming.py:482
Functionformat_predictions
TODO: Implement prediction formatting Takes model outputs and formats them into Prediction objects Steps: 1. Apply softmax to get p
projects/project-101-basic-model-serving/src/api.py:526
Methodgenerate
Generate text from a prompt. Args: prompt: Input text prompt max_tokens: Maximum tokens to generate
projects/project-103-llm-deployment/src/llm/server.py:134
Functiongenerate_api_key
Generate a secure API key. TODO: Implement key generation - Use cryptographically secure random - Include prefix for identification
projects/project-103-llm-deployment/src/api/middleware.py:591
Methodgenerate_report
TODO: Generate HTML/PDF evaluation report
projects/project-102-mlops-pipeline/src/training/evaluate.py:132
Functiongenerate_text
Generate text completion. Args: request: Generation request api_key: API key from dependency llm: LLM server from de
projects/project-103-llm-deployment/src/api/main.py:274
Functiongenerate_text_stream
Generate text with streaming response. Args: request: Generation request api_key: API key llm: LLM server Retur
projects/project-103-llm-deployment/src/api/main.py:328
Methodget_cache_stats
Get cache statistics. Returns: Dictionary with cache stats TODO: Return: - Number of cached items
projects/project-103-llm-deployment/src/rag/embeddings.py:305
Functionget_class_name
TODO: Map class ID to class name Load ImageNet class names or your model's class mapping Example: # Load class names from file
projects/project-101-basic-model-serving/src/api.py:558
Functionget_config_preset
Get predefined configuration presets for common scenarios. Args: preset_name: Name of preset (development, production, low_memory, e
projects/project-103-llm-deployment/src/llm/config.py:399
Functionget_development_settings
TODO: Get development-specific settings Returns settings optimized for development: - Debug logging - Auto-reload enabled - Smal
projects/project-101-basic-model-serving/src/config.py:580
Methodget_device
TODO: Get PyTorch device object Steps to implement: 1. Import torch 2. Create device from device string 3. R
projects/project-101-basic-model-serving/src/config.py:374
Methodget_embedding_dimension
Get the embedding dimension. Returns: Embedding dimension TODO: Return the embedding dimension from the model
projects/project-103-llm-deployment/src/rag/embeddings.py:280
Methodget_gpu_stats
Get current GPU utilization statistics. Returns: Dictionary with GPU metrics TODO: Implement GPU monitoring:
projects/project-103-llm-deployment/src/llm/server.py:297
Methodget_gpu_stats
Get current GPU statistics. TODO: Implement GPU stats collection - Query all GPUs - Get memory usage - Get u
projects/project-103-llm-deployment/src/monitoring/metrics.py:500
Functionget_llm_server
Dependency to get LLM server instance. Returns: LLM server TODO: Return LLM server from app state
projects/project-103-llm-deployment/src/api/main.py:177
Methodget_model_architecture_info
Extract model architecture information. Args: model: Model to analyze Returns: Architecture details
projects/project-103-llm-deployment/src/llm/optimization.py:454
Methodget_model_info
Get human-readable configuration summary. Returns: Dictionary with config summary TODO: Return summary includin
projects/project-103-llm-deployment/src/llm/config.py:343
Methodget_model_info
Get information about the loaded model. Returns: Dictionary with model metadata TODO: Return information about:
projects/project-103-llm-deployment/src/llm/server.py:275
Methodget_model_info
TODO: Get information about the loaded model Returns: Dictionary with model metadata Example: return {
projects/project-101-basic-model-serving/src/model.py:342
Functionget_model_path
TODO: Get path to model file Steps to implement: 1. Create Path object for models directory 2. Join with model filename 3. Check
projects/project-101-basic-model-serving/src/utils.py:231
Methodget_model_path
TODO: Get full path to model file Steps to implement: 1. If model_path is set, return it 2. Otherwise, construct pat
projects/project-101-basic-model-serving/src/config.py:397
Methodget_overall_health
Get overall system health status. Returns: Dictionary with overall health and component details TODO: 1
projects/project-102-mlops-pipeline/src/monitoring/health.py:299
Functionget_production_settings
TODO: Get production-specific settings Returns settings optimized for production: - Info logging - Auto-reload disabled - Larger
projects/project-101-basic-model-serving/src/config.py:601
Functionget_rag_pipeline
Dependency to get RAG pipeline instance. Returns: RAG pipeline TODO: Return RAG pipeline from app state
projects/project-103-llm-deployment/src/api/main.py:190
Functionget_settings
TODO: Get cached settings instance (singleton pattern) This ensures we only load settings once per application lifecycle. Steps to impl
projects/project-101-basic-model-serving/src/config.py:511
Functionget_stats
Get server statistics. Returns: Server stats and metrics TODO: Return statistics: 1. GPU utilization 2. Request counts
projects/project-103-llm-deployment/src/api/main.py:486
Methodget_summary
Get cost summary for time period. TODO: Implement summary generation - Filter events by time - Aggregate costs
projects/project-103-llm-deployment/src/monitoring/cost_tracker.py:397
Functionget_supported_models
TODO: Return list of supported model names Returns: List of model names that can be loaded Example: return [ 'resne
projects/project-101-basic-model-serving/src/model.py:418
Functionget_system_info
TODO: Get system information Steps to implement: 1. Get CPU info (cores, usage) 2. Get memory info (total, available, used) 3. G
projects/project-101-basic-model-serving/src/utils.py:657
Methodget_top_customers
Get top N customers by cost. TODO: Implement top customers query - Sort customers by cost - Return top N Ar
projects/project-103-llm-deployment/src/monitoring/cost_tracker.py:442
Functionget_top_predictions
TODO: Get top-k predictions from probabilities Steps to implement: 1. Apply softmax to get probabilities (if not already applied) 2.
projects/project-101-basic-model-serving/src/utils.py:335
Methodget_vllm_engine_args
Convert config to vLLM AsyncEngineArgs parameters. Returns: Dictionary of vLLM engine arguments TODO: Implement
projects/project-103-llm-deployment/src/llm/config.py:291
Functionglobal_exception_handler
Global exception handler. TODO: Implement error handling: 1. Log error with context 2. Track error metrics 3. Return user-friend
projects/project-103-llm-deployment/src/api/main.py:518
Functionhandle_inference_error
TODO: Handle inference errors and return formatted error response Steps to implement: 1. Log the error with traceback 2. Determine e
projects/project-101-basic-model-serving/src/utils.py:500
Methodhandle_missing_values
TODO: Handle missing values in dataset Steps: 1. Identify columns with missing values 2. Apply appropriate strategy
projects/project-102-mlops-pipeline/src/data/preprocessing.py:58
Functionhash_api_key
Hash API key for storage. TODO: Implement key hashing - Use SHA-256 or stronger - Return hex digest Args: api_key: Plai
projects/project-103-llm-deployment/src/api/middleware.py:613
Functionhealth
Overall health check endpoint.
projects/project-102-mlops-pipeline/src/monitoring/health.py:402
Functionhealth_check
Health check endpoint. Returns: Health status TODO: Implement comprehensive health check: 1. Check LLM server status 2.
projects/project-103-llm-deployment/src/api/main.py:222
Functionhealth_check
TODO: Implement comprehensive health check Health check should verify: 1. API is running 2. Model is loaded 3. Dependencies are
projects/project-101-basic-model-serving/src/api.py:306
Methodhealth_check
TODO: Perform health check on deployed model
projects/project-102-mlops-pipeline/src/deployment/deploy.py:76
Methodindex_documents
Index documents into vector database. TODO: Implement document indexing - Validate inputs - Create batches -
projects/project-103-llm-deployment/src/ingestion/indexer.py:101
Methodindex_documents_async
Index documents asynchronously. TODO: Implement async indexing - Create batches - Process batches concurrently
projects/project-103-llm-deployment/src/ingestion/indexer.py:535
Functioningest_raw_data
TODO: Implement data ingestion logic Steps: 1. Connect to data source (API, database, file system, etc.) 2. Download/fetch raw data
projects/project-102-mlops-pipeline/dags/data_pipeline.py:44
Methodinitialize
Initialize chat LLM with template loading. TODO: 1. Call parent initialization 2. Load chat template from tokenizer
projects/project-103-llm-deployment/src/llm/server.py:364
Functioninvalid_image
TODO: Create invalid image data for testing Returns: Invalid image bytes for testing error handling Implementation: ret
projects/project-101-basic-model-serving/tests/test_api.py:128
Methodis_development
TODO: Check if running in development Returns: True if environment is "development" Example usage:
projects/project-101-basic-model-serving/src/config.py:359
Methodis_production
TODO: Check if running in production Returns: True if environment is "production" Example usage: if
projects/project-101-basic-model-serving/src/config.py:344
Functionlifespan
Application lifespan manager. Handles startup and shutdown operations: - Model loading - Database connections - Resource cleanup
projects/project-103-llm-deployment/src/api/main.py:55
Functionlist_models
List available models. Returns: List of model information TODO: Return available models: 1. Get loaded model info 2. Li
projects/project-103-llm-deployment/src/api/main.py:469
Functionliveness
Kubernetes liveness probe.
projects/project-102-mlops-pipeline/src/monitoring/health.py:420
Methodload
Load a text file. TODO: Implement text loading - Read file with proper encoding - Handle encoding errors - E
projects/project-103-llm-deployment/src/ingestion/loader.py:112
Methodload
Load a PDF file. TODO: Implement PDF loading - Check if PDF library is available - Extract text from each page
projects/project-103-llm-deployment/src/ingestion/loader.py:223
Methodload
Load content from a URL. TODO: Implement web loading - Fetch HTML content - Parse with BeautifulSoup - Extra
projects/project-103-llm-deployment/src/ingestion/loader.py:347
Methodload
Load all documents from directory. TODO: Implement directory loading - Scan directory for files - Filter by file typ
projects/project-103-llm-deployment/src/ingestion/loader.py:485
Methodload_artifacts
TODO: Load preprocessing artifacts Args: artifacts_dir: Directory containing artifacts Returns: Dat
projects/project-102-mlops-pipeline/src/data/preprocessing.py:506
Functionload_class_labels
TODO: Load class labels from file Steps to implement: 1. Open labels file 2. Read lines 3. Strip whitespace 4. Return list o
projects/project-101-basic-model-serving/src/utils.py:256
Functionload_config_from_file
Load configuration from YAML or JSON file. Args: config_path: Path to configuration file Returns: Loaded configuration
projects/project-103-llm-deployment/src/llm/config.py:433
Functionload_image_from_bytes
TODO: Load PIL Image from bytes Steps to implement: 1. Create BytesIO object from bytes 2. Open image using PIL.Image.open() 3.
projects/project-101-basic-model-serving/src/utils.py:126
Functionload_model
TODO: Convenience function to load model Args: model_name: Name of model device: Device to use Returns: ModelIn
projects/project-101-basic-model-serving/src/model.py:372
Methodload_model
TODO: Load trained model from disk Args: model_path: Path to model file Returns: Loaded model
projects/project-102-mlops-pipeline/src/training/train.py:483
Functionload_sample_documents
Load sample documents for testing. Args: num_docs: Number of documents to load source: Document source ('wikipedia', 'arxiv'
projects/project-103-llm-deployment/notebooks/utils.py:330
Functionload_settings
TODO: Load application settings Steps to implement: 1. Create Settings instance (automatically loads from env) 2. Validate all setti
projects/project-101-basic-model-serving/src/config.py:471
Functionload_versioned_data
TODO: Load data versioned with DVC Steps: 1. Pull latest data from DVC remote 2. Load training, validation, and test datasets 3.
projects/project-102-mlops-pipeline/dags/training_pipeline.py:44
Functionlog_prediction
TODO: Log prediction with structured data Steps to implement: 1. Create log message with all relevant info 2. Include prediction det
projects/project-101-basic-model-serving/src/utils.py:448
Methodmeasure_tpot
Measure Time Per Output Token. Args: engine: LLM engine prompt: Test prompt num_tokens: Number o
projects/project-103-llm-deployment/src/llm/optimization.py:538
Methodmeasure_ttft
Measure Time to First Token. Args: engine: LLM engine prompt: Test prompt Returns: TTFT
projects/project-103-llm-deployment/src/llm/optimization.py:512
Functionmetrics
TODO: Implement Prometheus metrics endpoint This endpoint returns metrics in Prometheus format for scraping. Steps: 1. Import prome
projects/project-101-basic-model-serving/src/api.py:445
Functionmock_embedder
Mock embedding generator. TODO: Implement mock embedder - Return dummy embeddings - Support batch embedding - Configurable dimen
projects/project-103-llm-deployment/tests/conftest.py:97
Functionmock_llm_server
Mock LLM server for testing. TODO: Implement mock LLM server - Create mock with common methods - Configure return values - Track
projects/project-103-llm-deployment/tests/conftest.py:57
Functionmock_metrics
Mock metrics collector. TODO: Implement mock metrics - Create mock with recording methods - Track what was recorded - Return moc
projects/project-103-llm-deployment/tests/conftest.py:330
Functionmock_vector_db
Mock vector database. TODO: Implement mock vector DB - Mock upsert operation - Mock search operation - Track stored vectors
projects/project-103-llm-deployment/tests/conftest.py:132
Functionmodel_inference
TODO: Create ModelInference instance for testing Steps to implement: 1. Import ModelInference class 2. Create instance with test con
projects/project-101-basic-model-serving/tests/test_model.py:30
Methodoptimize_kv_cache
Calculate optimal KV cache configuration. The KV cache stores attention keys/values to avoid recomputation. vLLM uses PagedA
projects/project-103-llm-deployment/src/llm/optimization.py:179
Methodoptimize_memory_allocation
Optimize GPU memory allocation settings. Returns: Recommended memory settings TODO: Determine optimal:
projects/project-103-llm-deployment/src/llm/optimization.py:365
Functionoverride_settings
TODO: Create settings with overrides (useful for testing) Steps to implement: 1. Load base settings 2. Override with provided kwargs
projects/project-101-basic-model-serving/src/config.py:543
Functionperform_health_checks
TODO: Perform comprehensive health checks on deployed model Steps: 1. Check pod status (all running and ready) 2. Verify service end
projects/project-102-mlops-pipeline/dags/deployment_pipeline.py:430
Functionpredict
TODO: Implement prediction endpoint Main prediction endpoint that: 1. Accepts image file upload 2. Validates input 3. Preprocess
projects/project-101-basic-model-serving/src/api.py:352
← previousnext →201–300 of 523, ranked by callers