harness-providers: models.dev catalog + cost display wiring (M3)
- modelsdev.rs: ModelCatalog parses models.dev api.json → ModelInfo keyed by (provider, model); 24h file cache at ~/.cache/ai-harness/models.json with a baked assets/models-snapshot.json fallback so cost/limits work offline. load_cached_or_baked (no network) + refresh/refresh_default_cache (background). - App: loads the catalog at init (cached-or-baked, never blocks), warms the cache in a background task, and passes the session model's pricing into RunConfig.cost so session cost accrues for real. - TUI: AppState tracks session_cost/session_tokens from Session events; status bar shows "<tokens> · $<cost>". Snapshots updated. - 7 modelsdev tests (parse, defaults, unknown-model, baked snapshot, cache TTL, cached-vs-baked load). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"anthropic": {
|
||||
"id": "anthropic",
|
||||
"name": "Anthropic",
|
||||
"models": {
|
||||
"claude-sonnet-4-5": {
|
||||
"id": "claude-sonnet-4-5",
|
||||
"reasoning": true,
|
||||
"tool_call": true,
|
||||
"attachment": true,
|
||||
"cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 },
|
||||
"limit": { "context": 200000, "output": 64000 }
|
||||
},
|
||||
"claude-opus-4-1": {
|
||||
"id": "claude-opus-4-1",
|
||||
"reasoning": true,
|
||||
"tool_call": true,
|
||||
"attachment": true,
|
||||
"cost": { "input": 15, "output": 75, "cache_read": 1.5, "cache_write": 18.75 },
|
||||
"limit": { "context": 200000, "output": 32000 }
|
||||
},
|
||||
"claude-haiku-4-5": {
|
||||
"id": "claude-haiku-4-5",
|
||||
"reasoning": true,
|
||||
"tool_call": true,
|
||||
"attachment": true,
|
||||
"cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 1.25 },
|
||||
"limit": { "context": 200000, "output": 64000 }
|
||||
}
|
||||
}
|
||||
},
|
||||
"openai": {
|
||||
"id": "openai",
|
||||
"name": "OpenAI",
|
||||
"models": {
|
||||
"gpt-4o": {
|
||||
"id": "gpt-4o",
|
||||
"tool_call": true,
|
||||
"attachment": true,
|
||||
"cost": { "input": 2.5, "output": 10, "cache_read": 1.25 },
|
||||
"limit": { "context": 128000, "output": 16384 }
|
||||
},
|
||||
"gpt-4o-mini": {
|
||||
"id": "gpt-4o-mini",
|
||||
"tool_call": true,
|
||||
"attachment": true,
|
||||
"cost": { "input": 0.15, "output": 0.6, "cache_read": 0.075 },
|
||||
"limit": { "context": 128000, "output": 16384 }
|
||||
},
|
||||
"gpt-5": {
|
||||
"id": "gpt-5",
|
||||
"reasoning": true,
|
||||
"tool_call": true,
|
||||
"attachment": true,
|
||||
"cost": { "input": 1.25, "output": 10, "cache_read": 0.125 },
|
||||
"limit": { "context": 400000, "output": 128000 }
|
||||
},
|
||||
"o3": {
|
||||
"id": "o3",
|
||||
"reasoning": true,
|
||||
"tool_call": true,
|
||||
"cost": { "input": 2, "output": 8, "cache_read": 0.5 },
|
||||
"limit": { "context": 200000, "output": 100000 }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user