From d92923a964649bfa49d7d5c4cbbc7cedae3cf658 Mon Sep 17 00:00:00 2001 From: aiapienthusiast <327629069+aiapienthusiast@users.noreply.github.com> Date: Thu, 5 Nov 2026 02:58:56 +0000 Subject: [PATCH] Agent chat: a Cheaper Inference preset for OpenAI-compatible endpoints (#11174) --- crates/ui-egui/src/agent_chat/agents.rs | 3 +++ docs/agent-chat.md | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/agent_chat/agents.rs b/crates/ui-egui/src/agent_chat/agents.rs index 5448bebc9..c8efd4211 100644 --- a/crates/ui-egui/src/agent_chat/agents.rs +++ b/crates/ui-egui/src/agent_chat/agents.rs @@ -316,6 +316,7 @@ pub const OPENAI_PRESETS: &[ApiPreset] = &[ ApiPreset { name: "OpenCode Go", base_url: "https://opencode.ai/zen/go/v1" }, ApiPreset { name: "DeepSeek", base_url: "https://api.deepseek.com" }, ApiPreset { name: "Qwen", base_url: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1" }, + ApiPreset { name: "Cheaper Inference", base_url: "https://api.cheaperinference.com/v1" }, ApiPreset { name: "OpenRouter", base_url: "https://openrouter.ai/api/v1" }, ]; @@ -393,6 +394,7 @@ mod tests { fn keys_go_only_over_https_or_to_this_computer() { assert!(key_safe_for("https://api.openai.com/v1")); assert!(key_safe_for("https://api.mammouth.ai/v1")); + assert!(key_safe_for("https://api.cheaperinference.com/v1")); assert!(key_safe_for("http://localhost:11434/v1")); assert!(key_safe_for("http://127.0.0.1:1234/v1")); assert!(key_safe_for("http://[::1]:8080/v1")); @@ -503,6 +505,7 @@ mod tests { assert!(presets(Protocol::OpenAi).iter().all(|p| !p.name.is_empty() && p.base_url.starts_with("http"))); assert!(presets(Protocol::OpenAi).iter().any(|p| p.name == "Mammouth AI" && key_safe_for(p.base_url))); assert!(presets(Protocol::OpenAi).iter().any(|p| p.name == "Mistral AI" && p.base_url == "https://api.mistral.ai/v1")); + assert!(presets(Protocol::OpenAi).iter().any(|p| p.name == "Cheaper Inference" && key_safe_for(p.base_url))); assert!(presets(Protocol::Anthropic).iter().any(|p| p.base_url == "https://api.anthropic.com/v1")); for name in ["DeepSeek", "Qwen"] { assert!(presets(Protocol::OpenAi).iter().any(|p| p.name == name), "OpenAI-compatible preset for {name}"); diff --git a/docs/agent-chat.md b/docs/agent-chat.md index 9e269104e..387dccd82 100644 --- a/docs/agent-chat.md +++ b/docs/agent-chat.md @@ -292,7 +292,8 @@ Grok Build also supports `XAI_API_KEY` for users who choose API authentication. `http://localhost:1234/v1`, OpenClaw `http://localhost:18789/v1`, OpenAI, Mistral AI `https://api.mistral.ai/v1`, Mammouth AI `https://api.mammouth.ai/v1`, OpenCode Go `https://opencode.ai/zen/go/v1`, DeepSeek `https://api.deepseek.com`, - Qwen `https://dashscope-intl.aliyuncs.com/compatible-mode/v1`, OpenRouter + Qwen `https://dashscope-intl.aliyuncs.com/compatible-mode/v1`, Cheaper Inference + `https://api.cheaperinference.com/v1`, OpenRouter `https://openrouter.ai/api/v1`) or a custom URL, the model name, and an optional key. OpenCode Go models are routed to their endpoint by themselves (`/responses`, `/messages` or Gemini for those families, `/chat/completions` for the rest),