mirror of
https://github.com/codewhale-hq/Codewhale.git
synced 2026-11-09 17:10:44 -10:00
fix(client): grok-4.7 catalog row and effort ladder; MiMo replays reasoning for every id (#6501)
Finishes the interrupted follow-up on this branch. - grok-4.7 (https://docs.x.ai/docs/models/grok-4.7): bundled catalog row (500K context, text/image in, tool calls, structured output, effort low/medium/high/xhigh default high), tiered pricing 0.50/2.00/6.00 (2x at 200K), context window in model_registry and codewhale-models, picker list, agent static registry. Web search is not documented for 4.7, so it is not claimed. Default stays grok-4.6. - xAI reasoning_effort is driven by the catalog row's documented effort option; grok reasoning cannot be disabled so off -> high (https://docs.x.ai/docs/guides/reasoning). Drops the now-unused is_exact_xai_grok_4_6_route. - Xiaomi MiMo replays assistant reasoning_content for every model id (the API 400s on tool-call turns without it), unless effort is off. - Regenerated providers-export.golden.json (adds grok-4.7 to xai). - Docs: grok-4.7 in PROVIDERS/CONFIGURATION (en + zh_hans); zh_hans gains the reasoning_stream_style default note. sh scripts/with-hermetic-test-home.sh cargo test -p codewhale-tui --lib -- client::chat reasoning thinking stream -> 570 passed; 0 failed sh scripts/with-hermetic-test-home.sh cargo test -p codewhale-tui --lib -- grok xai pricing model_registry catalog mimo -> 399 passed; 0 failed; 2 ignored cargo test -p codewhale-config -> 692 passed + 9 + 1 (0 failed) cargo test -p codewhale-models -> 44 passed; cargo test -p codewhale-agent -> 70 passed python3 scripts/check-provider-registry.py -> passed cargo fmt --all -- --check -> clean Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
de3b11ede7
commit
6be755f315
13 files changed
+135
-47
No files matched your search
@@ -1356,6 +1356,15 @@ impl Default for ModelRegistry {
|
||||
supports_tools: true,
|
||||
supports_reasoning: true,
|
||||
},
|
||||
// https://docs.x.ai/docs/models/grok-4.7: function calling and
|
||||
// reasoning (low/medium/high/xhigh, cannot be disabled).
|
||||
ModelInfo {
|
||||
id: "grok-4.7".to_string(),
|
||||
provider: ProviderKind::Xai,
|
||||
aliases: vec![],
|
||||
supports_tools: true,
|
||||
supports_reasoning: true,
|
||||
},
|
||||
ModelInfo {
|
||||
id: "grok-4.5".to_string(),
|
||||
provider: ProviderKind::Xai,
|
||||
|
||||
@@ -2757,6 +2757,39 @@
|
||||
"XAI_API_KEY"
|
||||
],
|
||||
"models": {
|
||||
"grok-4.7": {
|
||||
"id": "grok-4.7",
|
||||
"name": "Grok 4.7",
|
||||
"family": "grok",
|
||||
"attachment": true,
|
||||
"reasoning": true,
|
||||
"reasoning_options": [
|
||||
{
|
||||
"type": "effort",
|
||||
"values": [
|
||||
"low",
|
||||
"medium",
|
||||
"high",
|
||||
"xhigh"
|
||||
],
|
||||
"default": "high"
|
||||
}
|
||||
],
|
||||
"tool_call": true,
|
||||
"structured_output": true,
|
||||
"modalities": {
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"output": [
|
||||
"text"
|
||||
]
|
||||
},
|
||||
"limit": {
|
||||
"context": 500000
|
||||
}
|
||||
},
|
||||
"grok-4.6": {
|
||||
"id": "grok-4.6",
|
||||
"name": "Grok 4.6",
|
||||
|
||||
@@ -1224,6 +1224,9 @@
|
||||
{
|
||||
"id": "grok-4.6",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"id": "grok-4.7"
|
||||
}
|
||||
],
|
||||
"transport": "chat-completions"
|
||||
|
||||
@@ -309,7 +309,7 @@ fn known_context_window_for_model(model_lower: &str) -> Option<u32> {
|
||||
| "mimo-v2.5-tts-voicedesign"
|
||||
| "mimo-v2.5-tts-voiceclone"
|
||||
| "mimo-v2-tts" => Some(8_000),
|
||||
"grok-4.6" | "grok-4.5" => Some(500_000),
|
||||
"grok-4.7" | "grok-4.6" | "grok-4.5" => Some(500_000),
|
||||
"grok-4.3" => Some(1_000_000),
|
||||
"grok-build" => Some(512_000),
|
||||
"grok-composer-2.5-fast" => Some(200_000),
|
||||
|
||||
@@ -16,10 +16,9 @@ use tokio::time::timeout as tokio_timeout;
|
||||
|
||||
use crate::config::{
|
||||
TOGETHER_INKLING_MODEL, is_exact_direct_moonshot_k3_route, is_exact_kimi_code_k3_route,
|
||||
is_exact_zai_chat_route, is_exact_zai_forced_thinking_route,
|
||||
is_exact_zai_tiered_effort_route, is_kimi_code_membership_model,
|
||||
minimax_m3_route_uses_max_completion_tokens, moonshot_base_url_is_exact_kimi_code,
|
||||
wire_model_for_provider_route,
|
||||
is_exact_zai_chat_route, is_exact_zai_forced_thinking_route, is_exact_zai_tiered_effort_route,
|
||||
is_kimi_code_membership_model, minimax_m3_route_uses_max_completion_tokens,
|
||||
moonshot_base_url_is_exact_kimi_code, wire_model_for_provider_route,
|
||||
};
|
||||
|
||||
// The bounded response-header wait (`stream_open_timeout`) and its env
|
||||
@@ -3490,6 +3489,14 @@ fn should_replay_reasoning_content_for_provider_on_route(
|
||||
return true;
|
||||
}
|
||||
|
||||
// Xiaomi MiMo's API requires the assistant `reasoning_content` back on
|
||||
// tool-call turns (omitting it is a 400), for every MiMo chat model, not
|
||||
// only the ids the offline catalog marks as reasoning (#6501). A turn
|
||||
// that produced no reasoning replays nothing.
|
||||
if provider == ApiProvider::XiaomiMimo {
|
||||
return true;
|
||||
}
|
||||
|
||||
if is_exact_mistral_chat_route(provider, base_url)
|
||||
&& mistral_model_has_adjustable_reasoning(model)
|
||||
{
|
||||
@@ -4892,9 +4899,9 @@ mod alias_thinking_detection_tests {
|
||||
apply_inkling_reasoning_effort, apply_kimi_code_fixed_sampling,
|
||||
apply_kimi_code_k3_reasoning_effort, apply_openai_reasoning_effort,
|
||||
apply_provider_token_limit, apply_route_reasoning_controls, is_reasoning_model_for_stream,
|
||||
provider_accepts_reasoning_content,
|
||||
reasoning_stream_style_for_route, requires_reasoning_content,
|
||||
should_replay_reasoning_content, should_replay_reasoning_content_for_provider,
|
||||
provider_accepts_reasoning_content, reasoning_stream_style_for_route,
|
||||
requires_reasoning_content, should_replay_reasoning_content,
|
||||
should_replay_reasoning_content_for_provider,
|
||||
should_replay_reasoning_content_for_provider_on_route,
|
||||
};
|
||||
use crate::config::ApiProvider;
|
||||
@@ -5634,24 +5641,49 @@ mod alias_thinking_detection_tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn grok_46_uses_exact_first_party_reasoning_effort_ladder() {
|
||||
for (requested, expected) in [
|
||||
("off", "high"),
|
||||
("low", "low"),
|
||||
("medium", "medium"),
|
||||
("high", "high"),
|
||||
("xhigh", "xhigh"),
|
||||
("max", "xhigh"),
|
||||
fn grok_47_and_46_use_exact_first_party_reasoning_effort_ladder() {
|
||||
// Both catalog rows document low/medium/high/xhigh; reasoning cannot
|
||||
// be disabled, so `off` is the documented default `high`.
|
||||
for model in [
|
||||
crate::config::XAI_GROK_4_7_MODEL,
|
||||
crate::config::XAI_GROK_4_6_MODEL,
|
||||
] {
|
||||
for (requested, expected) in [
|
||||
("off", "high"),
|
||||
("low", "low"),
|
||||
("medium", "medium"),
|
||||
("high", "high"),
|
||||
("xhigh", "xhigh"),
|
||||
("max", "xhigh"),
|
||||
] {
|
||||
let mut body = json!({});
|
||||
apply_route_reasoning_controls(
|
||||
&mut body,
|
||||
ApiProvider::Xai,
|
||||
crate::config::DEFAULT_XAI_BASE_URL,
|
||||
model,
|
||||
Some(requested),
|
||||
);
|
||||
assert_eq!(
|
||||
body,
|
||||
json!({ "reasoning_effort": expected }),
|
||||
"{model} {requested}"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// A row without a documented effort option (grok-4.3) and an id the
|
||||
// catalog does not know send nothing.
|
||||
for model in [crate::config::XAI_GROK_4_3_MODEL, "grok-9-unknown"] {
|
||||
let mut body = json!({});
|
||||
apply_route_reasoning_controls(
|
||||
&mut body,
|
||||
ApiProvider::Xai,
|
||||
crate::config::DEFAULT_XAI_BASE_URL,
|
||||
crate::config::XAI_GROK_4_6_MODEL,
|
||||
Some(requested),
|
||||
model,
|
||||
Some("medium"),
|
||||
);
|
||||
assert_eq!(body, json!({ "reasoning_effort": expected }), "{requested}");
|
||||
assert_eq!(body, json!({}), "{model}");
|
||||
}
|
||||
|
||||
let mut provider_default = json!({});
|
||||
@@ -6451,6 +6483,23 @@ mod alias_thinking_detection_tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn xiaomi_mimo_replays_reasoning_for_every_model_id() {
|
||||
// #6501: MiMo returns 400 when a tool-call turn omits the assistant
|
||||
// `reasoning_content`, including ids newer than the offline catalog.
|
||||
for model in ["mimo-v2.5-pro", "mimo-v2.6-pro", "mimo-v2.7-pro-unreleased"] {
|
||||
assert!(
|
||||
should_replay_reasoning_content_for_provider(ApiProvider::XiaomiMimo, model, None),
|
||||
"{model}"
|
||||
);
|
||||
}
|
||||
assert!(!should_replay_reasoning_content_for_provider(
|
||||
ApiProvider::XiaomiMimo,
|
||||
"mimo-v2.6-pro",
|
||||
Some("off"),
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn stream_display_does_not_authorize_reasoning_replay() {
|
||||
// #1542 stays fixed: rendering a reasoning delta as Thinking must not
|
||||
|
||||
@@ -1661,6 +1661,7 @@ pub fn model_completion_names_for_provider(provider: ApiProvider) -> Vec<&'stati
|
||||
],
|
||||
ApiProvider::Xai => vec![
|
||||
DEFAULT_XAI_MODEL,
|
||||
XAI_GROK_4_7_MODEL,
|
||||
XAI_GROK_4_5_MODEL,
|
||||
XAI_GROK_4_3_MODEL,
|
||||
XAI_GROK_BUILD_MODEL,
|
||||
@@ -10625,21 +10626,6 @@ pub(crate) fn is_exact_direct_moonshot_k3_route(
|
||||
&& model.trim().eq_ignore_ascii_case(MOONSHOT_KIMI_K3_MODEL)
|
||||
}
|
||||
|
||||
/// Whether a route is exactly xAI's first-party Grok 4.6 endpoint.
|
||||
#[must_use]
|
||||
pub(crate) fn is_exact_xai_grok_4_6_route(
|
||||
provider: ApiProvider,
|
||||
base_url: &str,
|
||||
model: &str,
|
||||
) -> bool {
|
||||
provider == ApiProvider::Xai
|
||||
&& codewhale_config::provider::is_exact_xai_platform_route(
|
||||
codewhale_config::ProviderKind::Xai,
|
||||
base_url,
|
||||
)
|
||||
&& model.trim().eq_ignore_ascii_case(XAI_GROK_4_6_MODEL)
|
||||
}
|
||||
|
||||
/// Whether a route uses either official Kimi Code K3 membership model.
|
||||
pub(crate) fn is_exact_kimi_code_k3_route(
|
||||
provider: ApiProvider,
|
||||
|
||||
@@ -251,6 +251,7 @@ pub const DEFAULT_OPENCODE_ZEN_MODEL: &str = "gpt-5.6";
|
||||
pub const DEFAULT_OPENCODE_ZEN_BASE_URL: &str = "https://opencode.ai/zen/v1";
|
||||
pub const DEFAULT_META_MODEL: &str = "muse-spark-1.2";
|
||||
pub const DEFAULT_META_BASE_URL: &str = "https://api.meta.ai/v1";
|
||||
pub const XAI_GROK_4_7_MODEL: &str = "grok-4.7";
|
||||
pub const XAI_GROK_4_6_MODEL: &str = "grok-4.6";
|
||||
pub const DEFAULT_XAI_MODEL: &str = XAI_GROK_4_6_MODEL;
|
||||
pub const XAI_GROK_4_5_MODEL: &str = "grok-4.5";
|
||||
|
||||
@@ -205,6 +205,7 @@ const SEED_MODEL_IDS: &[(&str, ModelProvider)] = &[
|
||||
("muse-spark-1.2", ModelProvider::Meta),
|
||||
("muse-spark-1.2-contributor", ModelProvider::Meta),
|
||||
// --- xAI / Grok (config DEFAULT_XAI_MODEL) ---
|
||||
("grok-4.7", ModelProvider::Xai),
|
||||
("grok-4.6", ModelProvider::Xai),
|
||||
("grok-4.5", ModelProvider::Xai),
|
||||
("grok-4.3", ModelProvider::Xai),
|
||||
@@ -333,6 +334,7 @@ mod tests {
|
||||
("muse-spark-1.1", Some(1_000_000)),
|
||||
("muse-spark-1.2", Some(1_000_000)),
|
||||
("muse-spark-1.2-contributor", Some(1_000_000)),
|
||||
("grok-4.7", Some(500_000)),
|
||||
("grok-4.6", Some(500_000)),
|
||||
("grok-4.5", Some(500_000)),
|
||||
("grok-4.3", Some(1_000_000)),
|
||||
|
||||
@@ -717,10 +717,13 @@ fn known_pricing_for_model(model_lower: &str) -> Option<ModelPricing> {
|
||||
"meta/muse-spark-1.2-contributor" | "muse-spark-1.2-contributor" => {
|
||||
Some(usd_only_pricing(0.002, 0.10, 0.20))
|
||||
}
|
||||
// Grok 4.6 / 4.5 / 4.3 double all token rates when the prompt reaches
|
||||
// 200K. Metadata-only lookups use the standard tier; turn auditing
|
||||
// below selects the exact usage-aware tier for the direct xAI route.
|
||||
"grok-4.6" | "grok-4.5" | "grok-4.3" => grok_tiered_pricing(model_lower, false),
|
||||
// Grok 4.7 / 4.6 / 4.5 / 4.3 double all token rates when the prompt
|
||||
// reaches 200K. Metadata-only lookups use the standard tier; turn
|
||||
// auditing below selects the exact usage-aware tier for the direct
|
||||
// xAI route.
|
||||
"grok-4.7" | "grok-4.6" | "grok-4.5" | "grok-4.3" => {
|
||||
grok_tiered_pricing(model_lower, false)
|
||||
}
|
||||
// Anthropic first-party rates including the published cache-read
|
||||
// discounts and 5-minute cache-write rates (2026-07-09 audit,
|
||||
// https://platform.claude.com/docs/en/about-claude/pricing). These sit
|
||||
@@ -942,12 +945,14 @@ fn is_minimax_m3(model: &str) -> bool {
|
||||
/// doubled tier once a prompt reaches 200K tokens. Verified 2026-08-17 against
|
||||
/// the model pages, whose embedded price tables carry both the standard and
|
||||
/// `LongContext` columns at exactly 2x:
|
||||
/// - <https://docs.x.ai/docs/models/grok-4.7>: 0.50 / 2.00 / 6.00 (verified
|
||||
/// 2026-09-23: $4.00 / $1.00 / $12.00 at or above 200K)
|
||||
/// - <https://docs.x.ai/docs/models/grok-4.6>: 0.50 / 2.00 / 6.00
|
||||
/// - <https://docs.x.ai/docs/models/grok-4.5>: 0.30 / 2.00 / 6.00
|
||||
/// - <https://docs.x.ai/docs/models/grok-4.3>: 0.20 / 1.25 / 2.50
|
||||
fn grok_tiered_pricing(model_lower: &str, long_context: bool) -> Option<ModelPricing> {
|
||||
let (cache_read, input, output) = match model_lower {
|
||||
"grok-4.6" => (0.50, 2.00, 6.00),
|
||||
"grok-4.7" | "grok-4.6" => (0.50, 2.00, 6.00),
|
||||
"grok-4.5" => (0.30, 2.00, 6.00),
|
||||
"grok-4.3" => (0.20, 1.25, 2.50),
|
||||
_ => return None,
|
||||
@@ -963,7 +968,7 @@ fn grok_tiered_pricing(model_lower: &str, long_context: bool) -> Option<ModelPri
|
||||
fn is_grok_tiered(model: &str) -> bool {
|
||||
matches!(
|
||||
model.trim().to_ascii_lowercase().as_str(),
|
||||
"grok-4.6" | "grok-4.5" | "grok-4.3"
|
||||
"grok-4.7" | "grok-4.6" | "grok-4.5" | "grok-4.3"
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1934,7 +1934,7 @@ reasoning contract, and all four membership ids omit generic sampling fields.
|
||||
- `insecure_skip_tls_verify` (bool, optional provider-table key): legacy compatibility key, disabled by default. When true on the active provider table, provider clients reject the configuration instead of skipping TLS certificate verification. Use `SSL_CERT_FILE` for corporate or private CA bundles; `codewhale doctor` reports stale uses of this setting.
|
||||
- `default_text_model` (string, optional): defaults to `deepseek-flash` for DeepSeek and `deepseek-anthropic`, `gpt-5.6` for OpenAI, `grok-4.6` for xAI, `deepseek-ai/deepseek-v4-pro` for NVIDIA NIM, `deepseek-ai/deepseek-v4-flash` for AtlasCloud, `deepseek-reasoner` for Wanjie Ark, `DeepSeek-V4-Pro` for Volcengine Ark, `deepseek/deepseek-v4-pro` for OpenRouter and Novita, `mimo-v2.5-pro` for Xiaomi MiMo, `accounts/fireworks/models/deepseek-v4-pro` for Fireworks, `deepseek-ai/DeepSeek-V4-Pro` for SiliconFlow and DeepInfra, `trinity-large-thinking` for Arcee AI, `kimi-k2.7-code` for Moonshot, `MiniMax-M3` for MiniMax, `GLM-5.3` for Z.ai, `step-3.7-flash` for StepFun, `ernie-4.0-turbo-8k` for Qianfan, `fugu` for Sakana AI, `deepseek-ai/DeepSeek-V4-Pro` for SGLang/vLLM, `deepseek-v4-flash` for local Ollama, and `gpt-oss:120b` for Ollama Cloud. Hugging Face and Together AI both default to `deepseek-ai/DeepSeek-V4-Pro`; `openai-codex` defaults to `gpt-5.6`; `anthropic` defaults to `claude-sonnet-4-6`; `openmodel` defaults to `deepseek-v4-flash`. Current public DeepSeek IDs include `deepseek-v4-pro` and `deepseek-flash` (V4.1 Flash, shipped as the unversioned id), both with 1M context windows, 384K max output, and thinking mode enabled by default. DeepSeek's live pricing/model page now labels the Pro backend `DeepSeek-V4-Pro-0813`; the callable API ID remains `deepseek-v4-pro`, so Codewhale does not send the backend label or the Claude Code-specific `deepseek-v4-pro[1m]` selector. DeepSeek retires `deepseek-chat` and `deepseek-reasoner` on July 24, 2026; direct first-party routes migrate both to `deepseek-v4-flash`, with omitted reasoning settings preserving their former non-thinking (`off`) and thinking (`high`) intent. Explicit `reasoning_effort` wins, and provider-owned ids on Wanjie Ark, aggregators, self-hosted runtimes, and custom endpoints are not globally rewritten. SiliconFlow retains its own mapping: `deepseek-reasoner` and `deepseek-r1` select its Pro model while `deepseek-chat` and `deepseek-v3` select Flash. Provider-specific mappings translate `deepseek-v4-pro` / `deepseek-v4-flash` to each provider's model ID where supported. OpenRouter also recognizes recent large IDs such as `arcee-ai/trinity-large-thinking`, `minimax/minimax-m3`, `minimax/minimax-m2.7`, `xiaomi/mimo-v2.5-pro`, `qwen/qwen3.6-flash`, `qwen/qwen3.6-35b-a3b`, `qwen/qwen3.6-max-preview`, `qwen/qwen3.6-27b`, `qwen/qwen3.6-plus`, `qwen/qwen3.7-max`, `google/gemma-4-31b-it`, `moonshotai/kimi-k2.7-code`, `moonshotai/kimi-k2.6`, `nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free`, and `nvidia/nemotron-3-ultra-550b-a55b`; direct Arcee uses bare IDs such as `trinity-large-thinking` and `trinity-large-preview`; direct Moonshot recognizes `kimi-k3`, `kimi-k2.7-code`, and `kimi-k2.6`. The exact Kimi Code endpoint recognizes bare `k3` for K3 and `kimi-for-coding` for K2.7; those membership IDs are distinct from the direct Moonshot IDs and are never rewritten across routes. Direct MiniMax recognizes `MiniMax-M3` and the documented M2.x chat model IDs; direct Z.ai recognizes `GLM-5.3` (the default), `GLM-5.2`, `GLM-5.1`, and `GLM-5-Turbo`, and OpenRouter recognizes the matching `z-ai/glm-5.1`, `z-ai/glm-5.2`, `z-ai/glm-5.3`, and `z-ai/glm-5-turbo` IDs — `GLM-5.3` has been live on the Z.ai Coding Plan since 2026-08-13; it inherits its catalog metadata from `GLM-5.2` until Z.ai publishes distinct 5.3 numbers and carries no price, and an explicit `GLM-5.2` selection keeps its own id; direct Sakana recognizes `fugu` and `fugu-ultra-20260615`; direct Xiaomi MiMo recognizes chat IDs `mimo-v2.5-pro`, `mimo-v2.5-pro-ultraspeed`, and `mimo-v2.5`, while TTS IDs are selected through `codewhale speech` / `tts`. Generic `openai`, `atlascloud`, `wanjie-ark`, `xiaomi-mimo`, `arcee`, `moonshot`, `minimax`, `openmodel`, `zai`, `stepfun`, `qianfan`, `sakana`, local Ollama, and Ollama Cloud model IDs are passed through unchanged after known aliases are normalized. OpenRouter and SiliconFlow provider configs with a custom `base_url` also preserve explicit model values, which lets OpenAI-compatible gateways accept bare model IDs. Use `/models` or `codewhale models` to discover live IDs from your configured endpoint. `CODEWHALE_MODEL` overrides this for a single process; `DEEPSEEK_MODEL` is the legacy alias.
|
||||
- TelecomJS uses `deepseek-v4-pro` only as a conservative pre-refresh fallback. Once its key-scoped `/models` catalog is available, the picker uses those live rows; Codewhale omits unsupported reasoning request fields on this route.
|
||||
- `reasoning_effort` (string, optional): `off`, `low`, `medium`, `high`, `max`, `xhigh`, or `ultracode`; defaults to the configured UI tier. DeepSeek Platform receives top-level `thinking` / `reasoning_effort` fields. Ollama Cloud's OpenAI-compatible Chat Completions route preserves its documented `none` / `low` / `medium` / `high` / `max` ladder (`off` is sent as `none`; `xhigh` and `ultracode` normalize to `max`). Direct xAI `grok-4.6` on exact `https://api.x.ai/v1` receives top-level `reasoning_effort = "low" | "medium" | "high" | "xhigh"`; `off` normalizes to `high`, `max`/`ultracode` to `xhigh`, and `auto` leaves the field omitted so xAI's documented default `high` applies. A custom xAI-compatible `base_url` does not inherit that dialect. Direct Moonshot `kimi-k3` on exact `https://api.moonshot.ai/v1` is always-thinking and receives only top-level `reasoning_effort = "low" | "high" | "max"`; `off` normalizes to `low`, and `medium` to `high`. Kimi Code membership `k3` on exact `https://api.kimi.com/coding/v1` instead receives nested `thinking.effort`, and its `off` setting also normalizes to enabled `low`. Normal dispatched `auto` uses Codewhale's auto-reasoning selector and sends a concrete route-normalized tier; only an omitted reasoning setting leaves the provider default in control. Neighboring gateways and model/endpoint combinations retain the generic Moonshot contract. OpenAI Codex normalizes stale `off` to `low` and sends `max` / `ultracode` as Responses `xhigh`. Z.ai receives documented `thinking` controls and treats enabled thinking as the GLM coding high/max lane. NVIDIA NIM receives equivalent settings through `chat_template_kwargs`.
|
||||
- `reasoning_effort` (string, optional): `off`, `low`, `medium`, `high`, `max`, `xhigh`, or `ultracode`; defaults to the configured UI tier. DeepSeek Platform receives top-level `thinking` / `reasoning_effort` fields. Ollama Cloud's OpenAI-compatible Chat Completions route preserves its documented `none` / `low` / `medium` / `high` / `max` ladder (`off` is sent as `none`; `xhigh` and `ultracode` normalize to `max`). Direct xAI `grok-4.7` and `grok-4.6` on exact `https://api.x.ai/v1` receive top-level `reasoning_effort = "low" | "medium" | "high" | "xhigh"` (the ladder comes from the bundled catalog row; `grok-4.5` maps `xhigh` to `high`, and rows without a documented effort such as `grok-4.3` get no field); Grok reasoning cannot be disabled, so `off` normalizes to `high`, `max`/`ultracode` to `xhigh`, and `auto` leaves the field omitted so xAI's documented default `high` applies. A custom xAI-compatible `base_url` does not inherit that dialect. Direct Moonshot `kimi-k3` on exact `https://api.moonshot.ai/v1` is always-thinking and receives only top-level `reasoning_effort = "low" | "high" | "max"`; `off` normalizes to `low`, and `medium` to `high`. Kimi Code membership `k3` on exact `https://api.kimi.com/coding/v1` instead receives nested `thinking.effort`, and its `off` setting also normalizes to enabled `low`. Normal dispatched `auto` uses Codewhale's auto-reasoning selector and sends a concrete route-normalized tier; only an omitted reasoning setting leaves the provider default in control. Neighboring gateways and model/endpoint combinations retain the generic Moonshot contract. OpenAI Codex normalizes stale `off` to `low` and sends `max` / `ultracode` as Responses `xhigh`. Z.ai receives documented `thinking` controls and treats enabled thinking as the GLM coding high/max lane. NVIDIA NIM receives equivalent settings through `chat_template_kwargs`.
|
||||
- `verbosity` (string, optional): `normal` or `concise`. `normal` keeps the
|
||||
default conversational prompt. `concise` appends a prompt discipline block
|
||||
for direct, low-chatter output; CLI noninteractive commands (`exec` and
|
||||
|
||||
+2
-2
@@ -716,7 +716,7 @@ overlay and lets DSH resolve its own keys.
|
||||
| `csdn` | `[providers.csdn]` | `CSDN_API_KEY` | `CSDN_BASE_URL`; default `https://ai.csdn.net/api/model/v1` | `glm_for_coding` (default; the Coding Plan's dedicated model id); other marketplace model ids pass through | CSDN 星图 (Starmap) OpenAI-compatible hosted platform. Coding Plan keys and general marketplace keys share the one endpoint, so billing follows the credential product, never the URL alone: routing `glm_for_coding` — the shipped default — or setting `mode = "coding_plan"`/`"plan"`/`"subscription"` bills as CSDN Coding Plan quota with no dollar estimates; any other model, or an explicit `pay-as-you-go`/`metered` mode, bills metered; an unrecognized mode or an endpoint off `ai.csdn.net/api/model/v1` reports `cost: unknown`. `CSDN_MODEL` is accepted. Provider aliases: `csdn-ai`, `csdn_ai`, `csdn-coding-plan`, `csdn_coding_plan`, `starmap`. |
|
||||
| `concentrate` | `[providers.concentrate]` | `CONCENTRATE_API_KEY` | `CONCENTRATE_BASE_URL`; default `https://api.concentrate.ai/v1` | `deepseek-v4-pro` (default; a plain catalog id lets the gateway pick the upstream provider); `provider/model` ids such as `openai/gpt-5.6-sol` pin one upstream; `concentrate/auto` is the gateway's own router; unauthenticated live `/v1/models` catalog | Concentrate OpenAI Responses-compatible gateway (`POST /v1/responses`, bearer Universal API key). Opt-in and BYOK only: your key, your Concentrate bill, zero Codewhale fee, no managed default. Requests carry only documented fields (the system prompt rides as a `system` input item). Contract: [API introduction](https://concentrate.ai/docs/api-reference/introduction), [request parameters](https://concentrate.ai/docs/api-reference/endpoint/request-parameters), [streaming](https://concentrate.ai/docs/api-reference/endpoint/streaming), [errors](https://concentrate.ai/docs/api-reference/endpoint/errors). See [Concentrate Notes](#concentrate-notes). |
|
||||
| `codewhale` | `[providers.codewhale]` | `CODEWHALE_API_KEY` | `CODEWHALE_API_BASE`; default `https://api.codewhale.net/v1` | `deepseek/deepseek-v4-pro` (default), `anthropic/claude-sonnet-5`, `openai/gpt-5.6` are offline bootstrap rows only; the authenticated `GET /v1/models` listing of the account's connected providers is the catalog authority | Codewhale API: account-backed model access over the provider keys the customer connected to their Codewhale account. One `cwc_key_…` account API key with the `models:infer` scope authenticates every model. Model ids are `provider/model` exactly as the account catalog returns them, and each row states its protocol (`chat-completions` → `/v1/chat/completions`, `anthropic-messages` → `/v1/messages`, `responses` → `/v1/responses`); every protocol uses `Authorization: Bearer`, never `x-api-key`. `CODEWHALE_API_BASE` must be HTTPS except on loopback. Connect provider keys with `codewhale account keys set <provider>`. Provider aliases: `codewhale-api`, `cw-api`, `codewhale-cloud`. |
|
||||
| `xai` | `[providers.xai]` | `XAI_API_KEY`, Codewhale-owned device OAuth, or explicit read-only Grok CLI consent | `XAI_BASE_URL`; default `https://api.x.ai/v1` | `grok-4.6` (default), `grok-4.5`, `grok-4.3`, `grok-build`, `grok-composer-2.5-fast`, `grok-4.20-0309-reasoning`, `grok-4.20-0309-non-reasoning` | xAI/Grok OpenAI-compatible Chat Completions route. Grok 4.6 has a 500K context window, text/image input, function calls, structured output, server-side web search, and `low`/`medium`/`high`/`xhigh` reasoning (default `high`). Its standard rates double when the prompt reaches 200K tokens; the same 2x long-context rule applies to `grok-4.5` (500K context, $2.00 / $0.30 cached / $6.00) and `grok-4.3` (1M context, $1.25 / $0.20 cached / $2.50) per their [model pages](https://docs.x.ai/docs/models/grok-4.5). There is no documented `latest`/`fast` alias and no published numeric output limit. **API-key** (default): Bearer token from console.x.ai via `XAI_API_KEY` / keyring / `api_key`. **OAuth**: `codewhale auth xai-device` uses SSH-friendly device login and Codewhale-owned storage, which may refresh itself. Existing Grok CLI credentials require `codewhale auth external-consent --provider xai --mode read-only`; the granted external file is never refreshed or rewritten. OAuth may return HTTP 403 on some SuperGrok tiers — keep API-key as the reliable fallback. `XAI_MODEL` is accepted. Provider aliases: `x-ai`, `x_ai`, `grok`. |
|
||||
| `xai` | `[providers.xai]` | `XAI_API_KEY`, Codewhale-owned device OAuth, or explicit read-only Grok CLI consent | `XAI_BASE_URL`; default `https://api.x.ai/v1` | `grok-4.6` (default), `grok-4.7`, `grok-4.5`, `grok-4.3`, `grok-build`, `grok-composer-2.5-fast`, `grok-4.20-0309-reasoning`, `grok-4.20-0309-non-reasoning` | xAI/Grok OpenAI-compatible Chat Completions route. Grok 4.6 has a 500K context window, text/image input, function calls, structured output, server-side web search, and `low`/`medium`/`high`/`xhigh` reasoning (default `high`). [Grok 4.7](https://docs.x.ai/docs/models/grok-4.7) has the same 500K window, text/image input, function calls, structured output, reasoning ladder and $2.00 / $0.50 cached / $6.00 rates; xAI documents no web-search support for it yet, so Codewhale does not claim it. Grok reasoning cannot be disabled ([reasoning guide](https://docs.x.ai/docs/guides/reasoning)). Its standard rates double when the prompt reaches 200K tokens; the same 2x long-context rule applies to `grok-4.5` (500K context, $2.00 / $0.30 cached / $6.00) and `grok-4.3` (1M context, $1.25 / $0.20 cached / $2.50) per their [model pages](https://docs.x.ai/docs/models/grok-4.5). There is no documented `latest`/`fast` alias and no published numeric output limit. **API-key** (default): Bearer token from console.x.ai via `XAI_API_KEY` / keyring / `api_key`. **OAuth**: `codewhale auth xai-device` uses SSH-friendly device login and Codewhale-owned storage, which may refresh itself. Existing Grok CLI credentials require `codewhale auth external-consent --provider xai --mode read-only`; the granted external file is never refreshed or rewritten. OAuth may return HTTP 403 on some SuperGrok tiers — keep API-key as the reliable fallback. `XAI_MODEL` is accepted. Provider aliases: `x-ai`, `x_ai`, `grok`. |
|
||||
| `modelstudio-token-plan` | `[providers.modelstudio_token_plan]` | `MODELSTUDIO_API_KEY`, `DASHSCOPE_API_KEY` | `MODELSTUDIO_TOKEN_PLAN_BASE_URL`; default `https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1` | `qwen3.8-max` (default), `qwen3.8-max-preview`, `qwen3.7-plus`, `qwen3.7-max`, `qwen3.6-flash`, `deepseek-v4-pro`, `deepseek-v4-flash-0731`, `glm-5.2` | Alibaba Cloud Model Studio Token Plan OpenAI-compatible Chat Completions route. Token Plan Personal and Team share this endpoint. `qwen3.8-max`, `qwen3.7-plus`, and `qwen3.7-max` can use provider-native web search through the Token Plan Responses Harness; the preview, Coding Plan, and Anthropic routes do not inherit that capability. All listed models are reasoning-capable text/coding models. DeepSeek and GLM entries are provider-scoped and do not collide with first-party routes. `MODELSTUDIO_TOKEN_PLAN_MODEL` is accepted. Provider aliases: `modelstudio-token-plan`, `alibaba-token-plan`, `dashscope-token-plan`. |
|
||||
| `modelstudio-token-plan-anthropic` | `[providers.modelstudio_token_plan_anthropic]` | `MODELSTUDIO_API_KEY`, `DASHSCOPE_API_KEY` | default `https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic` | Same model catalog as `modelstudio-token-plan` | Token Plan Anthropic-compatible Messages route (`/apps/anthropic`). Same API key as the OpenAI dialect. Provider aliases: `modelstudio-token-plan-anthropic`, `alibaba-token-plan-anthropic`. |
|
||||
| `modelstudio-coding-plan` | `[providers.modelstudio_coding_plan]` | `MODELSTUDIO_API_KEY`, `DASHSCOPE_API_KEY` | `MODELSTUDIO_CODING_PLAN_BASE_URL`; default `https://coding-intl.dashscope.aliyuncs.com/v1` | `qwen3.8-max` (default); same catalog as Token Plan | Alibaba Cloud Model Studio Coding Plan OpenAI-compatible Chat Completions route. `MODELSTUDIO_CODING_PLAN_MODEL` is accepted. Provider aliases: `modelstudio-coding-plan`, `alibaba-coding-plan`, `dashscope-coding-plan`. |
|
||||
@@ -960,7 +960,7 @@ endpoint when the endpoint supports model listing.
|
||||
| `longcat` | `LongCat-2.0` | yes | yes |
|
||||
| `opencode-go` | `deepseek-v4-pro`, `grok-4.5`, `glm-5.2`, `glm-5.1`, `kimi-k3`, `kimi-k2.7-code`, `kimi-k2.6`, `deepseek-v4-flash`, `mimo-v2.5`, `mimo-v2.5-pro` | yes | yes |
|
||||
| `meta` | `muse-spark-1.2` | yes | yes |
|
||||
| `xai` | `grok-4.6`, `grok-4.5`, `grok-4.3`, `grok-build`, `grok-composer-2.5-fast`, `grok-4.20-0309-reasoning`, `grok-4.20-0309-non-reasoning` | yes | yes for `grok-4.6`, `grok-4.5`, `grok-4.3`, `grok-build`, and `grok-4.20-0309-reasoning` |
|
||||
| `xai` | `grok-4.6`, `grok-4.7`, `grok-4.5`, `grok-4.3`, `grok-build`, `grok-composer-2.5-fast`, `grok-4.20-0309-reasoning`, `grok-4.20-0309-non-reasoning` | yes | yes for `grok-4.6`, `grok-4.7`, `grok-4.5`, `grok-4.3`, `grok-build`, and `grok-4.20-0309-reasoning` |
|
||||
| `google` | `gemini-3.1-pro-preview`, `gemini-3-pro-preview`, `gemini-3.7-flash`, `gemini-3.6-flash`, `gemini-3.5-flash`, `gemini-3.5-flash-lite`, `gemini-2.5-pro`, `gemini-2.5-flash` | yes | yes except `gemini-3.5-flash-lite` |
|
||||
| `mistral` | `mistral-code-latest`, `mistral-medium-latest`, `mistral-small-latest`, `mistral-large-latest` | yes | yes for Medium and Small (`reasoning_effort` `none` or `high` on exact first-party routes); deprecated native Magistral remains an always-on explicit compatibility ID; no for Code and Large |
|
||||
| `modelstudio-token-plan`, `modelstudio-coding-plan` | `qwen3.8-max`, `qwen3.8-max-preview`, `qwen3.7-plus`, `qwen3.7-max`, `qwen3.6-flash`, `deepseek-v4-pro`, `deepseek-v4-flash-0731`, `glm-5.2` | yes | yes |
|
||||
|
||||
@@ -1022,12 +1022,12 @@ DeepSeek V4 前缀缓存让 token 标签变得重要。这些数量保持分离
|
||||
- `mistral` 模型与推理契约:`[providers.mistral]` 默认 `mistral-code-latest`;`MISTRAL_MODEL` 覆盖它,两者都设置时通用 `CODEWHALE_MODEL` 覆盖胜出。当前选择器还列出 `mistral-medium-latest`、`mistral-small-latest` 和 `mistral-large-latest`。在确切的官方 HTTPS `/v1` 路由上,Medium 和 Small 只接受 `reasoning_effort = "none" | "high"` 并重放多态思考块。弃用的原生 Magistral ID 仍可显式配置,保持始终推理,绝不接收可调努力字段。
|
||||
- `context_window`(整数,可选的 provider 表键):当 OpenAI 兼容网关、托管模型别名或自托管运行时的上限与 Codewhale 的静态模型表不同时,覆盖活动 `[providers.<name>]` 路由的总上下文窗口。例如,`[providers.openai] context_window = 1000000` 让 OpenAI 兼容的 DashScope/Qwen 路由按 1M-token 窗口做预算,而不是保守回退。对 Kimi Code K3,保持 `model = "k3"`,只在会员计划包含 1M 访问时设置 `[providers.moonshot] context_window = 1048576`;否则省略它,以保留 262,144-token 安全基线。该值必须大于 0,影响提示上下文备注、压缩阈值、上下文压力检查和请求输出上限。完整解析顺序,以及如何看到哪一级产生了当前窗口:[上下文长度(context window)](#上下文长度context-window)。
|
||||
- `path_suffix`(字符串,可选的 provider 表键):覆盖不为 `/v1/chat/completions` 服务的 OpenAI 兼容网关的聊天补全路径。例如,`[providers.openai] path_suffix = "/chat/completions"` 把聊天请求发送到未版本化的 base URL 加 `/chat/completions`;`models` 和 `beta/*` 请求保持正常路由。
|
||||
- `reasoning_stream_style`(字符串,可选的 provider 表键):覆盖活动 provider 路由如何把流式推理与答案文本分开。用 `separate_field` 处理 `reasoning_content` / `reasoning` 增量,`inline_tags` 用于在 `delta.content` 内流式 `<think>...</think>` 的网关,`none` 则把传入内容完全按答案文本渲染。
|
||||
- `reasoning_stream_style`(字符串,可选的 provider 表键):覆盖活动 provider 路由如何把流式推理与答案文本分开。用 `separate_field` 处理 `reasoning_content` / `reasoning` 增量,`inline_tags` 用于在 `delta.content` 内流式 `<think>...</think>` 的网关,`none` 则把传入内容完全按答案文本渲染。未设置时,每条 Chat Completions 路由都使用 `separate_field`(Mistral 一方路由使用其类型化思考块);仅当网关把答案放在 `reasoning_content` 里流式发送时才设置 `none`。
|
||||
- `[providers.<name>.auth]`(表,可选):provider 作用域的认证源元数据。`source = "command"` 存储命令 argv 加可选 `timeout_ms`;`source = "secret"` 存储 `secret_id`。这个切片让 provider 就绪、`/provider` 和 doctor JSON 报告认证源类别,而不暴露命令 argv 输出或秘密值;执行命令和解析外部秘密材料由后续的解析器工作处理。
|
||||
- `insecure_skip_tls_verify`(bool,可选的 provider 表键):旧兼容键,默认禁用。活动 provider 表上为 true 时,provider 客户端拒绝该配置,而不是跳过 TLS 证书验证。企业或私有 CA 包用 `SSL_CERT_FILE`;`codewhale doctor` 报告此设置的过期使用。
|
||||
- `default_text_model`(字符串,可选):DeepSeek 和 `deepseek-anthropic` 默认 `deepseek-v4-pro`,OpenAI 是 `gpt-5.6`,xAI 是 `grok-4.6`,NVIDIA NIM 是 `deepseek-ai/deepseek-v4-pro`,AtlasCloud 是 `deepseek-ai/deepseek-v4-flash`,Wanjie Ark 是 `deepseek-reasoner`,火山方舟是 `DeepSeek-V4-Pro`,OpenRouter 和 Novita 是 `deepseek/deepseek-v4-pro`,小米 MiMo 是 `mimo-v2.5-pro`,Fireworks 是 `accounts/fireworks/models/deepseek-v4-pro`,SiliconFlow 和 DeepInfra 是 `deepseek-ai/DeepSeek-V4-Pro`,Arcee AI 是 `trinity-large-thinking`,Moonshot 是 `kimi-k2.7-code`,MiniMax 是 `MiniMax-M3`,Z.ai 是 `GLM-5.3`,StepFun 是 `step-3.7-flash`,千帆是 `ernie-4.0-turbo-8k`,Sakana AI 是 `fugu`,SGLang/vLLM 是 `deepseek-ai/DeepSeek-V4-Pro`,本地 Ollama 是 `deepseek-v4-flash`,Ollama Cloud 是 `gpt-oss:120b`。Hugging Face 和 Together AI 都默认 `deepseek-ai/DeepSeek-V4-Pro`;`openai-codex` 默认 `gpt-5.6`;`anthropic` 默认 `claude-sonnet-4-6`;`openmodel` 默认 `deepseek-v4-flash`。当前公开 DeepSeek ID 是 `deepseek-v4-pro` 和 `deepseek-v4-flash`,两者都是 1M 上下文窗口、384K 最大输出、默认启用思考模式。DeepSeek 的实时定价/模型页现在把 Pro 后端标为 `DeepSeek-V4-Pro-0813`;可调用的 API ID 仍是 `deepseek-v4-pro`,所以 Codewhale 不发送后端标签或 Claude Code 特有的 `deepseek-v4-pro[1m]` 选择器。DeepSeek 于 2026 年 7 月 24 日退役 `deepseek-chat` 和 `deepseek-reasoner`;直接官方路由把两者迁移到 `deepseek-v4-flash`,省略的推理设置保留它们之前的不思考(`off`)和思考(`high`)意图。显式 `reasoning_effort` 胜出,Wanjie Ark、聚合器、自托管运行时和自定义端点上的 provider 自有 id 不会全局重写。SiliconFlow 保留自己的映射:`deepseek-reasoner` 和 `deepseek-r1` 选择其 Pro 模型,而 `deepseek-chat` 和 `deepseek-v3` 选择 Flash。Provider 特有映射在受支持处把 `deepseek-v4-pro` / `deepseek-v4-flash` 翻译成每个 provider 的模型 ID。OpenRouter 还识别最近的较大 ID,如 `arcee-ai/trinity-large-thinking`、`minimax/minimax-m3`、`minimax/minimax-m2.7`、`xiaomi/mimo-v2.5-pro`、`qwen/qwen3.6-flash`、`qwen/qwen3.6-35b-a3b`、`qwen/qwen3.6-max-preview`、`qwen/qwen3.6-27b`、`qwen/qwen3.6-plus`、`qwen/qwen3.7-max`、`google/gemma-4-31b-it`、`moonshotai/kimi-k2.7-code`、`moonshotai/kimi-k2.6`、`nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free` 和 `nvidia/nemotron-3-ultra-550b-a55b`;直接 Arcee 用 `trinity-large-thinking` 和 `trinity-large-preview` 这样的裸 ID;直接 Moonshot 识别 `kimi-k3`、`kimi-k2.7-code` 和 `kimi-k2.6`。确切的 Kimi Code 端点识别 K3 的裸 `k3` 和 K2.7 的 `kimi-for-coding`;这些会员 ID 与直接 Moonshot ID 不同,从不跨路由重写。直接 MiniMax 识别 `MiniMax-M3` 和记录的 M2.x 聊天模型 ID;直接 Z.ai 识别 `GLM-5.3`(默认)、`GLM-5.2`、`GLM-5.1` 和 `GLM-5-Turbo`,OpenRouter 识别匹配的 `z-ai/glm-5.1`、`z-ai/glm-5.2`、`z-ai/glm-5.3` 和 `z-ai/glm-5-turbo` ID——`GLM-5.3` 自 2026-08-13 起在 Z.ai Coding Plan 上线;它从 `GLM-5.2` 继承其目录元数据,直到 Z.ai 发布不同的 5.3 数字,不携带价格,显式 `GLM-5.2` 选择保持自己的 id;直接 Sakana 识别 `fugu` 和 `fugu-ultra-20260615`;直接小米 MiMo 识别聊天 ID `mimo-v2.5-pro`、`mimo-v2.5-pro-ultraspeed` 和 `mimo-v2.5`,而 TTS ID 通过 `codewhale speech` / `tts` 选择。通用 `openai`、`atlascloud`、`wanjie-ark`、`xiaomi-mimo`、`arcee`、`moonshot`、`minimax`、`openmodel`、`zai`、`stepfun`、`qianfan`、`sakana`、本地 Ollama 和 Ollama Cloud 模型 ID 在已知别名规范化后原样透传。带自定义 `base_url` 的 OpenRouter 和 SiliconFlow provider 配置也保留显式模型值,这让 OpenAI 兼容网关能接受裸模型 ID。用 `/models` 或 `codewhale models` 从你的配置端点发现实时 ID。`CODEWHALE_MODEL` 为单个进程覆盖它;`DEEPSEEK_MODEL` 是旧别名。
|
||||
- TelecomJS 只把 `deepseek-v4-pro` 用作刷新前的保守回退。其 key 作用域 `/models` 目录可用后,选择器使用那些实时行;Codewhale 在该路由上省略不支持的推理请求字段。
|
||||
- `reasoning_effort`(字符串,可选):`off`、`low`、`medium`、`high`、`max`、`xhigh` 或 `ultracode`;默认已配置的 UI 层级。DeepSeek Platform 收到顶层 `thinking` / `reasoning_effort` 字段。Ollama Cloud 的 OpenAI 兼容 Chat Completions 路由保留其记录的 `none` / `low` / `medium` / `high` / `max` 阶梯(`off` 作为 `none` 发送;`xhigh` 和 `ultracode` 规范化为 `max`)。确切 `https://api.x.ai/v1` 上的直接 xAI `grok-4.6` 收到顶层 `reasoning_effort = "low" | "medium" | "high" | "xhigh"`;`off` 规范化为 `high`,`max`/`ultracode` 为 `xhigh`,`auto` 让字段省略,这样 xAI 记录的默认 `high` 生效。自定义 xAI 兼容 `base_url` 不继承该方言。确切 `https://api.moonshot.ai/v1` 上的直接 Moonshot `kimi-k3` 始终思考,只收到顶层 `reasoning_effort = "low" | "high" | "max"`;`off` 规范化为 `low`,`medium` 为 `high`。确切 `https://api.kimi.com/coding/v1` 上的 Kimi Code 会员 `k3` 改为收到嵌套 `thinking.effort`,其 `off` 设置也规范化为启用的 `low`。常规调度 `auto` 使用 Codewhale 的自动推理选择器,发送具体的路由规范化层级;只有省略推理设置时才让 provider 默认值控制。相邻网关和模型/端点组合保留通用 Moonshot 契约。OpenAI Codex 把过期 `off` 规范化为 `low`,把 `max` / `ultracode` 作为 Responses `xhigh` 发送。Z.ai 收到记录的 `thinking` 控制,把启用思考视为 GLM coding high/max 通道。NVIDIA NIM 通过 `chat_template_kwargs` 收到等效设置。
|
||||
- `reasoning_effort`(字符串,可选):`off`、`low`、`medium`、`high`、`max`、`xhigh` 或 `ultracode`;默认已配置的 UI 层级。DeepSeek Platform 收到顶层 `thinking` / `reasoning_effort` 字段。Ollama Cloud 的 OpenAI 兼容 Chat Completions 路由保留其记录的 `none` / `low` / `medium` / `high` / `max` 阶梯(`off` 作为 `none` 发送;`xhigh` 和 `ultracode` 规范化为 `max`)。确切 `https://api.x.ai/v1` 上的直接 xAI `grok-4.7` 和 `grok-4.6` 收到顶层 `reasoning_effort = "low" | "medium" | "high" | "xhigh"`(阶梯来自内置目录行;`grok-4.5` 把 `xhigh` 映射为 `high`,没有记录 effort 的行如 `grok-4.3` 不发送该字段);Grok 推理无法关闭,因此 `off` 规范化为 `high`,`max`/`ultracode` 为 `xhigh`,`auto` 让字段省略,这样 xAI 记录的默认 `high` 生效。自定义 xAI 兼容 `base_url` 不继承该方言。确切 `https://api.moonshot.ai/v1` 上的直接 Moonshot `kimi-k3` 始终思考,只收到顶层 `reasoning_effort = "low" | "high" | "max"`;`off` 规范化为 `low`,`medium` 为 `high`。确切 `https://api.kimi.com/coding/v1` 上的 Kimi Code 会员 `k3` 改为收到嵌套 `thinking.effort`,其 `off` 设置也规范化为启用的 `low`。常规调度 `auto` 使用 Codewhale 的自动推理选择器,发送具体的路由规范化层级;只有省略推理设置时才让 provider 默认值控制。相邻网关和模型/端点组合保留通用 Moonshot 契约。OpenAI Codex 把过期 `off` 规范化为 `low`,把 `max` / `ultracode` 作为 Responses `xhigh` 发送。Z.ai 收到记录的 `thinking` 控制,把启用思考视为 GLM coding high/max 通道。NVIDIA NIM 通过 `chat_template_kwargs` 收到等效设置。
|
||||
- `verbosity`(字符串,可选):`normal` 或 `concise`。`normal` 保持默认的对话式提示。`concise` 追加一块提示纪律,用于直接、少废话的输出;CLI 非交互命令(`exec` 和 `eval`)默认 `concise`,除非 config/环境/CLI 覆盖它。用 `CODEWHALE_VERBOSITY` 或旧别名 `DEEPSEEK_VERBOSITY` 按进程覆盖。
|
||||
- `telemetry`(bool,可选):当前 0.9.12 源码中匿名使用计数**默认 `true`**。第 `5` 版告知列明 Codewhale 和 PostHog,说明默认开启且可退出;不会代替用户记录同意。此前明确退出的选择继续有效。这里的 `false` 是持久退出:删除随机安装 id、清空缓冲和 dry-run 记录并写入持续生效的 tombstone,优先于命令行或环境中的 `true`。在 `/settings` 中明确重新开启,或执行 `codewhale config set telemetry true`,会更新现有偏好和隐私记录,供新会话使用。`CODEWHALE_TELEMETRY=0`(旧别名 `DEEPSEEK_TELEMETRY`)或 `--telemetry false` 只关闭本次运行而不擦除用户状态。仓库本地配置不能修改这个偏好。`codewhale config telemetry` 显示告知,`codewhale config get telemetry` 报告偏好和隐私状态。完整 schema 和退出规则:[`TELEMETRY.md`](TELEMETRY.md)。
|
||||
- `telemetry_endpoint`(字符串,可选):批次 POST 到哪。保持未设置会选择随附默认 **`https://telemetry.codewhale.net/v1/telemetry`**——[`TELEMETRY.md`](TELEMETRY.md) 中描述的第一方接入服务,其源码在 `telemetry-ingest/`。这个键只决定*被允许的会话*发送到哪里;它不能覆盖选择退出。把它设为**空字符串**是保持启用且不联系任何人的方式:每个批次随后写入 `$CODEWHALE_HOME/telemetry/dryrun.jsonl`,完全不构造 HTTP 客户端,所以你可以读到原本会发送的确切内容。任何其他值直接替换默认值。要求 `https://`;普通 `http://` 只对 loopback 主机接受,并且没有环境变量可以覆盖该拒绝。被拒绝的端点会让遥测在本次运行关闭,而不是回退到明文或默认值。用 `CODEWHALE_TELEMETRY_ENDPOINT`(旧别名 `DEEPSEEK_TELEMETRY_ENDPOINT`)按进程覆盖,其中空值意味着同样的"不联系任何人"。仓库本地的 `.codewhale/config.toml` 不能设置它。
|
||||
|
||||
@@ -428,7 +428,7 @@ Kimi 仍然仅支持 API 密钥;对 Kimi 的外部授权被拒绝。
|
||||
| `edenai` | `[providers.edenai]` | `EDENAI_API_KEY` | `EDENAI_BASE_URL`;默认 `https://api.edenai.run/v3`;欧盟 `https://api.eu.edenai.run/v3` | `deepseek/deepseek-v4-pro`(默认);`provider/model` id 的实时 `/models` 目录 | Eden AI OpenAI 兼容聚合网关。目录行保持提供商范围;通用推理控制被省略,因为受支持的字段取决于所选上游家族。接受 `EDENAI_MODEL`。默认的 `deepseek/deepseek-v4-pro` 只列在全球目录上;在欧盟端点上把 `EDENAI_MODEL`(或 `model`)设为欧盟 `/models` 列表中的一行,例如 `qwen/deepseek-v4-pro`。提供商别名:`eden-ai`, `eden_ai`。 |
|
||||
| `zenmux` | `[providers.zenmux]` | `ZENMUX_API_KEY` | `ZENMUX_BASE_URL`;默认 `https://zenmux.ai/api/v1` | `deepseek/deepseek-v4.1-flash`(默认);`provider/model` id 的实时 `/models` 目录(免密钥可读) | ZenMux OpenAI 兼容聚合网关(约 190 个模型)。目录行保持提供商范围;通用推理控制被省略,因为受支持的字段取决于所选上游家族。接受 `ZENMUX_MODEL`。提供商别名:`zen-mux`, `zen_mux`。 |
|
||||
| `csdn` | `[providers.csdn]` | `CSDN_API_KEY` | `CSDN_BASE_URL`;默认 `https://ai.csdn.net/api/model/v1` | `glm_for_coding`(默认;Coding Plan 专用模型 id);其他市场模型 id 直通 | CSDN 星图(Starmap)OpenAI 兼容托管平台。Coding Plan 密钥与通用市场密钥共用一个端点,因此计费取决于凭据产品而非 URL 本身:路由 `glm_for_coding`(出厂默认)或设置 `mode = "coding_plan"`/`"plan"`/`"subscription"` 按 CSDN Coding Plan 配额计费,不显示美元估算;任何其他模型或显式 `pay-as-you-go`/`metered` 模式按量计费;无法识别的模式或 `ai.csdn.net/api/model/v1` 之外的端点报告 `cost: unknown`。接受 `CSDN_MODEL`。提供商别名:`csdn-ai`, `csdn_ai`, `csdn-coding-plan`, `csdn_coding_plan`, `starmap`。 |
|
||||
| `xai` | `[providers.xai]` | `XAI_API_KEY`、Codewhale 自有的设备 OAuth,或显式的只读 Grok CLI 授权 | `XAI_BASE_URL`;默认 `https://api.x.ai/v1` | `grok-4.6`(默认), `grok-4.5`, `grok-4.3`, `grok-build`, `grok-composer-2.5-fast`, `grok-4.20-0309-reasoning`, `grok-4.20-0309-non-reasoning` | xAI/Grok OpenAI 兼容 Chat Completions 路由。Grok 4.6 有 500K 上下文窗口、文本/图像输入、函数调用、结构化输出、服务端 web 搜索和 `low`/`medium`/`high`/`xhigh` 推理(默认 `high`)。提示达到 200K token 时其标准费率翻倍;同样的 2 倍长上下文规则适用于 `grok-4.5`(500K 上下文,$2.00 / $0.30 缓存 / $6.00)和 `grok-4.3`(1M 上下文,$1.25 / $0.20 缓存 / $2.50),按其[模型页](https://docs.x.ai/docs/models/grok-4.5)。没有文档化的 `latest`/`fast` 别名,也没有公布的数字输出上限。**API 密钥**(默认):来自 console.x.ai 的 Bearer token,通过 `XAI_API_KEY` / keyring / `api_key`。**OAuth**:`codewhale auth xai-device` 使用 SSH 友好的设备登录和 Codewhale 自有的存储,它可能自行刷新。现有的 Grok CLI 凭据需要 `codewhale auth external-consent --provider xai --mode read-only`;被授予的外部文件从不刷新或重写。OAuth 在某些 SuperGrok 层级上可能返回 HTTP 403——把 API 密钥作为可靠回退。接受 `XAI_MODEL`。提供商别名:`x-ai`, `x_ai`, `grok`。 |
|
||||
| `xai` | `[providers.xai]` | `XAI_API_KEY`、Codewhale 自有的设备 OAuth,或显式的只读 Grok CLI 授权 | `XAI_BASE_URL`;默认 `https://api.x.ai/v1` | `grok-4.6`(默认), `grok-4.7`, `grok-4.5`, `grok-4.3`, `grok-build`, `grok-composer-2.5-fast`, `grok-4.20-0309-reasoning`, `grok-4.20-0309-non-reasoning` | xAI/Grok OpenAI 兼容 Chat Completions 路由。Grok 4.6 有 500K 上下文窗口、文本/图像输入、函数调用、结构化输出、服务端 web 搜索和 `low`/`medium`/`high`/`xhigh` 推理(默认 `high`)。[Grok 4.7](https://docs.x.ai/docs/models/grok-4.7) 有相同的 500K 窗口、文本/图像输入、函数调用、结构化输出、推理阶梯和 $2.00 / $0.50 缓存 / $6.00 费率;xAI 尚未记录其 web 搜索支持,因此 Codewhale 不声明。Grok 推理无法关闭([推理指南](https://docs.x.ai/docs/guides/reasoning))。提示达到 200K token 时其标准费率翻倍;同样的 2 倍长上下文规则适用于 `grok-4.5`(500K 上下文,$2.00 / $0.30 缓存 / $6.00)和 `grok-4.3`(1M 上下文,$1.25 / $0.20 缓存 / $2.50),按其[模型页](https://docs.x.ai/docs/models/grok-4.5)。没有文档化的 `latest`/`fast` 别名,也没有公布的数字输出上限。**API 密钥**(默认):来自 console.x.ai 的 Bearer token,通过 `XAI_API_KEY` / keyring / `api_key`。**OAuth**:`codewhale auth xai-device` 使用 SSH 友好的设备登录和 Codewhale 自有的存储,它可能自行刷新。现有的 Grok CLI 凭据需要 `codewhale auth external-consent --provider xai --mode read-only`;被授予的外部文件从不刷新或重写。OAuth 在某些 SuperGrok 层级上可能返回 HTTP 403——把 API 密钥作为可靠回退。接受 `XAI_MODEL`。提供商别名:`x-ai`, `x_ai`, `grok`。 |
|
||||
| `modelstudio-token-plan` | `[providers.modelstudio_token_plan]` | `MODELSTUDIO_API_KEY`, `DASHSCOPE_API_KEY` | `MODELSTUDIO_TOKEN_PLAN_BASE_URL`;默认 `https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1` | `qwen3.8-max`(默认), `qwen3.8-max-preview`, `qwen3.7-plus`, `qwen3.7-max`, `qwen3.6-flash`, `deepseek-v4-pro`, `deepseek-v4-flash-0731`, `glm-5.2` | 阿里云 Model Studio Token Plan OpenAI 兼容 Chat Completions 路由。Token Plan 个人版和团队版共享该端点。列出的所有模型都是可推理的文本/编码模型。DeepSeek 和 GLM 条目是提供商范围的,不与第一方路由冲突。接受 `MODELSTUDIO_TOKEN_PLAN_MODEL`。提供商别名:`modelstudio-token-plan`, `alibaba-token-plan`, `dashscope-token-plan`。 |
|
||||
| `modelstudio-token-plan-anthropic` | `[providers.modelstudio_token_plan_anthropic]` | `MODELSTUDIO_API_KEY`, `DASHSCOPE_API_KEY` | 默认 `https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic` | 与 `modelstudio-token-plan` 相同的模型目录 | Token Plan Anthropic 兼容 Messages 路由(`/apps/anthropic`)。与 OpenAI 方言相同的 API 密钥。提供商别名:`modelstudio-token-plan-anthropic`, `alibaba-token-plan-anthropic`。 |
|
||||
| `modelstudio-coding-plan` | `[providers.modelstudio_coding_plan]` | `MODELSTUDIO_API_KEY`, `DASHSCOPE_API_KEY` | `MODELSTUDIO_CODING_PLAN_BASE_URL`;默认 `https://coding-intl.dashscope.aliyuncs.com/v1` | `qwen3.8-max`(默认);与 Token Plan 相同的目录 | 阿里云 Model Studio Coding Plan OpenAI 兼容 Chat Completions 路由。接受 `MODELSTUDIO_CODING_PLAN_MODEL`。提供商别名:`modelstudio-coding-plan`, `alibaba-coding-plan`, `dashscope-coding-plan`。 |
|
||||
@@ -537,7 +537,7 @@ OpenRouter completions 和静态注册表行包括自 2026 年 4 月起通过 Op
|
||||
| `longcat` | `LongCat-2.0` | 是 | 是 |
|
||||
| `opencode-go` | `deepseek-v4-pro`, `grok-4.5`, `glm-5.2`, `glm-5.1`, `kimi-k3`, `kimi-k2.7-code`, `kimi-k2.6`, `deepseek-v4-flash`, `mimo-v2.5`, `mimo-v2.5-pro` | 是 | 是 |
|
||||
| `meta` | `muse-spark-1.2` | 是 | 是 |
|
||||
| `xai` | `grok-4.6`, `grok-4.5`, `grok-4.3`, `grok-build`, `grok-composer-2.5-fast`, `grok-4.20-0309-reasoning`, `grok-4.20-0309-non-reasoning` | 是 | `grok-4.6`, `grok-4.5`, `grok-4.3`, `grok-build` 和 `grok-4.20-0309-reasoning` 是 |
|
||||
| `xai` | `grok-4.6`, `grok-4.7`, `grok-4.5`, `grok-4.3`, `grok-build`, `grok-composer-2.5-fast`, `grok-4.20-0309-reasoning`, `grok-4.20-0309-non-reasoning` | 是 | `grok-4.6`, `grok-4.7`, `grok-4.5`, `grok-4.3`, `grok-build` 和 `grok-4.20-0309-reasoning` 是 |
|
||||
| `google` | `gemini-3.1-pro-preview`, `gemini-3-pro-preview`, `gemini-3.7-flash`, `gemini-3.6-flash`, `gemini-3.5-flash`, `gemini-3.5-flash-lite`, `gemini-2.5-pro`, `gemini-2.5-flash` | 是 | 除 `gemini-3.5-flash-lite` 外都是 |
|
||||
| `mistral` | `mistral-code-latest`, `mistral-medium-latest`, `mistral-small-latest`, `mistral-large-latest` | 是 | Medium 和 Small 是(在精确的第一方路由上 `reasoning_effort` 为 `none` 或 `high`);已弃用的原生 Magistral 仍然是始终启用的显式兼容 ID;Code 和 Large 否 |
|
||||
| `modelstudio-token-plan`, `modelstudio-coding-plan` | `qwen3.8-max`, `qwen3.8-max-preview`, `qwen3.7-plus`, `qwen3.7-max`, `qwen3.6-flash`, `deepseek-v4-pro`, `deepseek-v4-flash-0731`, `glm-5.2` | 是 | 是 |
|
||||
|
||||
Reference in new issue
Block a user