Commit Graph
38 Commits
Author SHA1 Message Date
Xubin RenandXubin Ren c4628038c6 fix: handle image_url rejection by retrying without images
Replace the static provider-level supports_vision check with a
reactive fallback: when a model returns an image-unsupported error,
strip image_url blocks from messages and retry once. This avoids
maintaining an inaccurate vision capability table and correctly
handles gateway/unknown model scenarios.

Also extract _safe_chat() to deduplicate try/except boilerplate
in chat_with_retry().
2026-03-15 22:32:34 +08:00
coldxiangyuandXubin Ren de0b5b3d91 fix: filter image_url for non-vision models at provider layer
- Add  field to ProviderSpec (default True)
- Add  and  methods in LiteLLMProvider
- Filter image_url content blocks in  before sending to non-vision models
- Reverts session-layer filtering from original PR (wrong layer)

This fixes the issue where switching from Claude (vision-capable) to
non-vision models (e.g., Baidu Qianfan) causes API errors due to
unsupported image_url content blocks.

The provider layer is the correct place for this filtering because:
1. It has access to model/provider capabilities
2. It only affects non-vision models
3. It preserves session layer purity (storage should not know about model capabilities)
2026-03-15 22:32:34 +08:00
Xubin RenandXubin Ren 196e0ddbb6 fix(openrouter): revert custom_llm_provider, always apply gateway prefix 2026-03-15 10:52:36 +08:00
Xubin RenandXubin Ren 350d110fb9 fix(openrouter): remove litellm_prefix to prevent double-prefixed model names
With custom_llm_provider kwarg handling routing, the openrouter/ prefix
caused model names like anthropic/claude-sonnet-4-6 to become
openrouter/anthropic/claude-sonnet-4-6, which OpenRouter API rejects.
2026-03-15 10:52:36 +08:00
Paresh MathurandXubin Ren 445e0aa2c4 refactor(openrouter): move litellm kwargs into registry 2026-03-15 10:52:36 +08:00
gaoyiman 8865b6848c Merge branch 'main' into feat-volcengine-tuning 2026-03-12 14:56:05 +08:00
Jerome Sonnet (letzdoo)andClaude Opus 4.6 dee4f27dce feat: add Ollama as a local LLM provider
Add native Ollama support so local models (e.g. nemotron-3-nano) can be
used without an API key. Adds ProviderSpec with ollama_chat LiteLLM
prefix, ProvidersConfig field, and skips API key validation for local
providers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:13:14 +04:00
Kunal Karmakar 33c52cfb74 Merge branch 'main' of https://github.com/kunalk16/nanobot into feat-support-azure-openai 2026-03-06 10:39:29 +00:00
Kunal Karmakar 813d37ad35 Support Azure OpenAI 2026-03-06 08:43:58 +00:00
Re-bin b817463939 chore: simplify Alibaba Coding Plan to apiBase hint, remove dedicated provider 2026-03-06 07:13:04 +00:00
ouyangwulin 6770a6e7e9 supported aliyun coding plan. 2026-03-05 17:34:36 +08:00
ouyangwulin cf3e7e3f38 feat: Add Alibaba Cloud Coding Plan API support
Add dashscope_coding_plan provider to registry with OpenAI-compatible
endpoint for BaiLian coding assistance.

- Supports API key detection by 'sk-sp-' prefix pattern
- Adds provider config schema entry for proper loading
- Updates documentation with configuration instructions
- Fixes duplicate MatrixConfig class issue in schema
- Follow existing nanobot provider patterns for consistency
2026-03-05 16:54:15 +08:00
gaoyiman 0d60acf2d5 fix(schema): rename volcengine_plan and byteplus_plan to *_coding_plan for consistency 2026-03-05 14:40:18 +08:00
gaoyimanandGitHub 80bf5e55f1 Merge branch 'HKUDS:main' into feat-volcengine-tuning 2026-03-05 14:14:33 +08:00
Nikolas de Hor cc8864dc1f fix: remove overly broad "codex" keyword from openai_codex provider
The bare keyword "codex" causes false positive matches when any model
name happens to contain "codex" (e.g. "gpt-5.3-codex" on a custom
provider).  This incorrectly routes the request through the OAuth-based
OpenAI Codex provider, producing "OAuth credentials not found" errors
even when a valid custom api_key and api_base are configured.

Keep only the explicit "openai-codex" keyword so that auto-detection
requires the canonical prefix.  Users can still set provider: "custom"
to force the custom endpoint, but auto-detection should not collide.

Closes #1311
2026-02-28 01:01:20 -03:00
gaoyiman cf2ed8a6a0 tune volcengine provider 2026-02-26 16:22:24 +08:00
init-new-world deae84482d fix: change VolcEngine litellm prefix from openai to volcengine 2026-02-22 00:42:41 +08:00
tercerapersonaandGitHub b286457c85 add Openrouter prompt caching via cache_control 2026-02-20 11:34:50 -03:00
Re-bin 82a318759f Merge branch 'main' into pr-812 2026-02-20 08:42:31 +00:00
Re-bin afa0513243 Merge branch 'main' into pr-854 2026-02-20 08:17:32 +00:00
Re-bin b11f0ce6a9 fix: prefer explicit provider prefix over keyword match to fix Codex routing 2026-02-19 17:39:44 +00:00
tercerapersonaandClaude Sonnet 4.6 3b4763b3f9 feat: add Anthropic prompt caching via cache_control
Inject cache_control: {"type": "ephemeral"} on the system message and
last tool definition for providers that support prompt caching. Adds
supports_prompt_caching flag to ProviderSpec (enabled for Anthropic only)
and skips caching when routing through a gateway.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 11:05:22 -03:00
PiEgg 9789307dd6 Fix Codex provider routing for GitHub Copilot models 2026-02-19 13:30:02 +08:00
Your Name 1663517998 feat: Add VolcEngine LLM provider support
- Add VolcEngine ProviderSpec entry in registry.py
- Add volcengine to ProvidersConfig class in schema.py
- Update model providers table in README.md
- Add description about VolcEngine coding plan endpoint
2026-02-19 03:02:16 +08:00
Re-bin 80a5a8c983 feat: add siliconflow provider support 2026-02-18 03:52:53 +00:00
ras_botandCursor e5e5f02e73 merge: upstream/main into feat/add-siliconflow-provider, resolve schema conflict
- Keep siliconflow in ProvidersConfig
- Keep openai_codex and github_copilot from upstream/main

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-18 10:50:15 +08:00
Re-bin e2a0d63909 feat: add custom provider with direct openai-compatible support 2026-02-18 02:39:15 +00:00
Darye 5033ac1759 Added Github Copilot Provider 2026-02-16 15:02:12 +01:00
Re-bin 1ce586e9f5 fix: resolve Codex provider bugs and simplify implementation 2026-02-16 11:43:36 +00:00
Re-bin 9e5f7348fe Merge branch 'main' into pr-151 2026-02-16 09:19:40 +00:00
Zhiwei LiandCursor 66cd21e6ec feat: add SiliconFlow provider support
Add SiliconFlow (硅基流动) as an OpenAI-compatible gateway provider.
SiliconFlow hosts multiple models (Qwen, DeepSeek, etc.) via an
OpenAI-compatible API at https://api.siliconflow.cn/v1.

Changes:
- Add ProviderSpec for siliconflow in providers/registry.py
- Add siliconflow field to ProvidersConfig in config/schema.py

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-14 20:27:10 +11:00
Re-bin b76cf05c3a feat: add custom provider and non-destructive onboard 2026-02-13 16:05:00 +00:00
Re-bin 39dd7feb28 resolve conflicts with main and adapt MiniMax 2026-02-10 16:27:10 +00:00
pinhua33 ae908e0dcd Merge upstream/main: resolve conflicts with OAuth support 2026-02-09 15:13:11 +08:00
Re-bin eb2fbf80da fix: use config key to detect provider, prevent api_base misidentifying as vLLM 2026-02-08 19:31:25 +00:00
pinhua33 08efe6ad3f refactor: add OAuth support to provider registry system
- Add is_oauth and oauth_provider fields to ProviderSpec
- Update _make_provider() to use registry for OAuth provider detection
- Update get_provider() to support OAuth providers (no API key required)
- Mark OpenAI Codex as OAuth-based provider in registry

This improves the provider registry architecture to support OAuth-based
authentication flows, making it extensible for future OAuth providers.

Benefits:
- OAuth providers are now registry-driven (not hardcoded)
- Extensible design: new OAuth providers only need registry entry
- Backward compatible: existing API key providers unaffected
- Clean separation: OAuth logic centralized in registry
2026-02-08 16:48:11 +08:00
pinhua33 c1dc8d3f55 fix: integrate OpenAI Codex provider with new registry system
- Add OpenAI Codex ProviderSpec to registry.py
- Add openai_codex config field to ProvidersConfig in schema.py
- Mark Codex as OAuth-based (no API key required)
- Set appropriate default_api_base for Codex API

This integrates the Codex OAuth provider with the refactored
provider registry system introduced in upstream commit 299d8b3.
2026-02-08 16:33:46 +08:00
Re-bin 299d8b33b3 refactor: replace provider if-elif chains with declarative registry 2026-02-08 07:29:31 +00:00