Spaces:
Running
Running
|
Download config/codemap.md from Deign86/mathpulse-api-v3test: direct link, hf CLI and curl.
- Browser
- Download file 1.39 kB
-
https://huggingface.co/spaces/Deign86/mathpulse-api-v3test/resolve/main/config/codemap.md
- Command line
-
hf download hf://spaces/Deign86/mathpulse-api-v3test/config/codemap.md
-
curl -L -o codemap.md https://huggingface.co/spaces/Deign86/mathpulse-api-v3test/resolve/main/config/codemap.md
1.39 kB
backend/config/
Responsibility
Holds model routing and AI API cost configuration: models.yaml defines generation/embedding models and task policies; ai_pricing.py exposes Claude pricing tiers.
Design
models.yamlis declarative:models,model_capabilities,routing.task_model_map, andtask_fallback_model_map.- With no
MODEL_PROFILE, the map sends RAG lessons and risk narratives toclaude-opus-5-5(adaptive thinking). Every profile exportsINFERENCE_MODEL_ID=claude-haiku-5-5, which overrides the whole map; onlyprodkeeps RAG lessons on Opus, viaHF_RAG_MODEL_ID. Fallback routes useclaude-haiku-5-5. Embeddings useBAAI/bge-small-en-v1.5and are configured separately from generation. - The pricing table holds per-million-token rates for each model.
get_full_pricing(model_id)returns a copy of the model's rates and raisesValueErrorfor unknown IDs.
Flow
Model-routing consumers resolve a task to a model and its fallback using the YAML mappings; pricing consumers pass model IDs to get_full_pricing.
Integration
backend/main.py and inference/model-routing services consume model configuration; RAG uses the embedding model for curriculum retrieval. services.cost_calculator imports config.ai_pricing.get_full_pricing; YAML embedding configuration is explicitly separate from the admin-swappable generation pipeline.