v0.7.0: image input, model registry, prefix-cache savings
ci / linux (clang) (push) Successful in 4m41s
ci / linux (gcc) (push) Successful in 5m35s
ci / musl (push) Failing after 30s
ci / windows-cross (push) Successful in 9m59s

Images
- vision gate: text-only models get a note instead of image parts and no
  view_image tool; unknown models retry once without images on HTTP 400
- paste: Ctrl+V and /attach paste read the clipboard (wl-paste, xclip,
  pngpaste/osascript, Win32 PNG or CF_DIB converted to PNG); pasting image
  file paths attaches them
- MCP image content is stored in the session and sent with the tool result
- attach: rel path validation, base64 decode, /retry keeps images

Model registry
- built-in src/models_builtin.json embedded at build time, merged with
  <config>/models.json and cached GET /models metadata (context, vision,
  pricing); most specific rule wins per field
- /model labels, /status source, --list-models [provider]

Cache and cost
- stable request prefix (frozen tools, notes as messages), DeepSeek prefix
  completion, OpenAI/Anthropic cache hints, /cost and hit rate in the status
This commit is contained in:
WHC
2026-10-08 20:34:09 +08:00
parent 0226f417ff
commit 895b47274c
32 changed files with 5825 additions and 429 deletions
+70
View File
@@ -0,0 +1,70 @@
{
"providers": {
"minimax": {
"api_base": "https://api.minimax.cn/v1",
"key_env": "MINIMAX_API_KEY",
"default_model": "MiniMax-M2.7",
"models": ["MiniMax-M2.7", "MiniMax-M2.5"]
},
"deepseek": {
"api_base": "https://api.deepseek.com/v1",
"key_env": "DEEPSEEK_API_KEY",
"default_model": "deepseek-flash",
"models": ["deepseek-flash", "deepseek-v4-pro"],
"reasoning_passback": true,
"prefix_completion": true,
"effort": "passthrough"
},
"openai": {
"api_base": "https://api.openai.com/v1",
"key_env": "OPENAI_API_KEY",
"default_model": "gpt-4.1-mini",
"models": ["gpt-4.1-mini", "gpt-4o"],
"effort": "openai"
},
"teamorouter": {
"api_base": "https://api.teamorouter.com/v1",
"key_env": "TEAMOROUTER_API_KEY",
"default_model": ""
}
},
"models": [
{"match": "deepseek", "context": 1000000, "vision": false,
"price": {"currency": "¥", "miss": 2, "hit": 0.04, "out": 8, "offpeak_half": true}},
{"match": "deepseek-v4-pro",
"price": {"currency": "¥", "miss": 9, "hit": 0.3, "out": 27, "offpeak_half": true}},
{"match": "deepseek-vl", "vision": true},
{"match": "minimax", "context": 196608, "vision": false},
{"match": "gpt-", "cache": "openai"},
{"match": "gpt-4.1", "context": 1047576, "vision": true,
"price": {"currency": "$", "miss": 2, "hit": 0.5, "out": 8}},
{"match": "gpt-4.1-mini",
"price": {"currency": "$", "miss": 0.4, "hit": 0.1, "out": 1.6}},
{"match": "gpt-4o", "context": 128000, "vision": true,
"price": {"currency": "$", "miss": 2.5, "hit": 1.25, "out": 10}},
{"match": "gpt-4o-mini",
"price": {"currency": "$", "miss": 0.15, "hit": 0.075, "out": 0.6}},
{"match": "gpt-5", "context": 400000, "vision": true, "reasoning": true},
{"match": "o1", "vision": true, "cache": "openai", "reasoning": true},
{"match": "o3", "context": 200000, "vision": true, "cache": "openai", "reasoning": true},
{"match": "o4", "context": 200000, "vision": true, "cache": "openai", "reasoning": true},
{"match": "anthropic/", "cache": "anthropic"},
{"match": "claude", "context": 200000, "vision": true, "cache": "anthropic"},
{"match": "claude-sonnet",
"price": {"currency": "$", "miss": 3, "hit": 0.3, "write": 3.75, "out": 15}},
{"match": "gemini", "context": 1048576, "vision": true},
{"match": "grok", "context": 256000},
{"match": "grok-4", "vision": true},
{"match": "qwen", "context": 131072},
{"match": "glm", "context": 128000},
{"match": "glm-*v*", "vision": true},
{"match": "kimi", "context": 131072},
{"match": "pixtral", "vision": true},
{"match": "llava", "vision": true},
{"match": "*-vl*", "vision": true},
{"match": "*vision*", "vision": true}
]
}