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
encode_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
Method
engineer_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
Method
enrich
Add enriched metadata to document. TODO: Implement metadata enrichment - Extract keywords - Calculate statistics
projects/project-103-llm-deployment/src/ingestion/processor.py:379
Function
estimate_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
Function
estimate_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
Method
estimate_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
Method
estimate_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
Method
estimate_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
Function
estimate_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
Method
evaluate_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
Function
evaluate_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
Function
evaluate_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
Method
evaluate_regression
TODO: Evaluate regression model Calculate MSE, RMSE, MAE, R2 score Create residual plots
projects/project-102-mlops-pipeline/src/training/evaluate.py:105
Function
event_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
Method
export_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
Function
extract_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
Method
fetch_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
Method
fetch_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
Method
fetch_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
Method
fetch_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
Method
filter
Filter documents. TODO: Implement filtering pipeline - Filter by length - Filter by language - Remove duplic
projects/project-103-llm-deployment/src/ingestion/processor.py:234
Method
fit_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
Method
flush
Flush buffer contents. TODO: Implement flush - Return all buffered tokens - Clear buffer
projects/project-103-llm-deployment/src/api/streaming.py:482
Function
format_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
Method
generate
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
Function
generate_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
Method
generate_report
TODO: Generate HTML/PDF evaluation report
projects/project-102-mlops-pipeline/src/training/evaluate.py:132
Function
generate_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
Function
generate_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
Method
get_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
Function
get_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
Function
get_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
Function
get_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
Method
get_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
Method
get_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
Method
get_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
Method
get_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
Function
get_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
Method
get_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
Method
get_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
Method
get_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
Method
get_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
Function
get_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
Method
get_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
Method
get_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
Function
get_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
Function
get_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
Function
get_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
Function
get_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
Method
get_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
Function
get_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
Function
get_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
Method
get_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
Function
get_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
Method
get_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
Function
global_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
Function
handle_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
Method
handle_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
Function
hash_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
Function
health
Overall health check endpoint.
projects/project-102-mlops-pipeline/src/monitoring/health.py:402
Function
health_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
Function
health_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
Method
health_check
TODO: Perform health check on deployed model
projects/project-102-mlops-pipeline/src/deployment/deploy.py:76
Method
index_documents
Index documents into vector database. TODO: Implement document indexing - Validate inputs - Create batches -
projects/project-103-llm-deployment/src/ingestion/indexer.py:101
Method
index_documents_async
Index documents asynchronously. TODO: Implement async indexing - Create batches - Process batches concurrently
projects/project-103-llm-deployment/src/ingestion/indexer.py:535
Function
ingest_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
Method
initialize
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
Function
invalid_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
Method
is_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
Method
is_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
Function
lifespan
Application lifespan manager. Handles startup and shutdown operations: - Model loading - Database connections - Resource cleanup
projects/project-103-llm-deployment/src/api/main.py:55
Function
list_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
Function
liveness
Kubernetes liveness probe.
projects/project-102-mlops-pipeline/src/monitoring/health.py:420
Method
load
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
Method
load
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
Method
load
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
Method
load
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
Method
load_artifacts
TODO: Load preprocessing artifacts Args: artifacts_dir: Directory containing artifacts Returns: Dat
projects/project-102-mlops-pipeline/src/data/preprocessing.py:506
Function
load_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
Function
load_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
Function
load_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
Function
load_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
Method
load_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
Function
load_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
Function
load_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
Function
load_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
Function
log_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
Method
measure_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
Method
measure_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
Function
metrics
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
Function
mock_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
Function
mock_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
Function
mock_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
Function
mock_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
Function
model_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
Method
optimize_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
Method
optimize_memory_allocation
Optimize GPU memory allocation settings. Returns: Recommended memory settings TODO: Determine optimal:
projects/project-103-llm-deployment/src/llm/optimization.py:365
Function
override_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
Function
perform_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
Function
predict
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
← previous
next →
201–300 of 523, ranked by callers