Commit graph

24 commits

Author SHA1 Message Date
1bcMax
becda53a17
feat: add ClawRouter as a provider for cost-optimized model routing (#11751)
* feat: add ClawRouter as a provider for cost-optimized model routing

ClawRouter is an open-source LLM router that automatically selects the
cheapest capable model for each request based on prompt complexity,
providing 78-96% cost savings on blended inference costs.

Changes:
- Add ClawRouterApi class extending OpenAI adapter
- Add 'clawrouter' provider to the type system
- Add ClawRouter models (auto, free, eco)
- Add ClawRouter provider config with UI setup
- Add ClawRouter logo
- Add documentation (clawrouter.mdx)

Closes #10843

* docs: enhance ClawRouter documentation

- Add ClawRouter to providers overview
- Expand documentation with:
  - Model capabilities configuration
  - Multiple roles setup
  - Troubleshooting section
  - Cost monitoring
  - Comparison with OpenRouter
  - Complexity dimensions explanation

* feat: add ClawRouter to core/llm/llms

- Add ClawRouter.ts extending OpenAI base class
- Register ClawRouter in llms/index.ts

* feat: add User-Agent headers for ClawRouter integration tracking

- Add 'User-Agent: Continue/IDE' header to identify Continue requests
- Add 'X-Continue-Provider: clawrouter' header for routing analytics
- Enhanced documentation with features list

This helps ClawRouter optimize routing decisions based on integration
source and enables better analytics for the Continue community.

* feat: complete ClawRouter integration with full provider support

- Add clawrouter to PROVIDER_HANDLES_TEMPLATING (autodetect.ts)
- Add clawrouter to PROVIDER_SUPPORTS_IMAGES (autodetect.ts)
- Add clawrouter tool support function (toolSupport.ts)
- Add supportsReasoningField and supportsReasoningDetailsField
- Add promptTemplates with osModelsEditPrompt
- Match OpenRouter implementation patterns

* feat: add ClawRouter to VS Code schema, docs nav, and AI SDK

- Add clawrouter to VS Code config_schema.json provider enum
- Add ClawRouter description in config_schema.json
- Add clawrouter to docs.json navigation (top-level providers)
- Add clawrouter to AI SDK PROVIDER_MAP

* docs: add wallet setup and x402 payment documentation

- Add Wallet & Payment Setup section to clawrouter.mdx
- Document payment tiers (free/eco/auto)
- Add wallet funding instructions (Solana/Base USDC)
- Add spend control configuration
- Update VS Code schema description with wallet info
- Update provider longDescription with payment options

* feat: add premium tier and enhanced ClawRouter features

- Add blockrun/premium routing profile (mission-critical tasks)
- Add dual-chain wallet support docs (Base EVM + Solana)
- Add model exclusion documentation
- Update routing profiles table with savings percentages
- Update comparison table with auth/payment differences
- Total 44+ models, 4 routing tiers

* test: add ClawRouter unit tests

- Add ClawRouter.vitest.ts (core/llm/llms)
  - Provider name verification
  - Default options validation
  - Reasoning field support
  - User-Agent header verification
  - Routing profiles acceptance

- Add ClawRouter.test.ts (openai-adapters)
  - Default apiBase
  - Custom apiBase override
  - Continue headers
  - OpenAI standard headers

- Add clawrouter tests to toolSupport.test.ts
  - blockrun/* routing profiles
  - Tool-supporting model patterns

* docs: add routing profile switching and enhanced error handling docs

- Add 'Switching Between Routing Profiles' section with full examples
- Add /model command tip for quick switching
- Add 'Error Handling' section comparing Continue vs ClawRouter
- Document automatic error recovery (429, 402, 500+, timeout)
- Add response header documentation for diagnostics
- Add AI-powered doctor command for troubleshooting

* fix: address PR review feedback - move docs to /more, resize logo, add provider constants, fix docs example

* fix: replace clawrouter logo with higher-res brand kit version (128x128)
2026-03-26 10:26:12 -07:00
Dallin Romney
a33cd37041
fix(openrouter): Gemini 3 tool support, suffix stripping, thought_signature, autocomplete endpoint (#11856)
* fix: multiple OpenRouter provider improvements

- Add google/gemini-3 to tool support prefixes so Gemini 3 models are
  detected as supporting tools via OpenRouter (#8980)
- Strip :free/:extended/:beta suffixes before matching in OpenRouter
  tool support, fixing models like meta-llama/llama-3.2-3b-instruct:free
  not being recognized (#11095)
- Add thought_signature fallback for Gemini models via OpenRouter to
  prevent 400 errors when tool calling (#8980)
- Fix autocomplete/next-edit forcing legacy /completions endpoint on
  OpenRouter, which only supports /chat/completions (#3648)
- Enrich OpenRouter error messages with provider metadata details
  instead of showing generic "Provider returned error" (#11262, #11577)

* fix: remove error enrichment, add TODO for OpenRouter error extraction

* chore: clean up verbose comments and add OpenRouter tool support tests

* style: fix prettier formatting in toolSupport.ts
2026-03-25 20:31:53 -07:00
Dallin Romney
09650d4a4f
fix(gemini): update model catalog for retired/new Gemini models (#11793)
* fix(gemini): update model catalog for retired/new Gemini models

Gemini 1.x models are fully retired (returning 404), gemini-3-pro-preview
was shut down March 9 2026, and new 3.1 series models were missing.

- Add gemini-3.1-pro-preview, gemini-3.1-flash-lite-preview, gemini-3.1-flash-image-preview
- Replace gemini-3-pro-preview with gemini-3.1-pro-preview everywhere
- Remove retired Gemini 1.x models (gemini-1.0-pro, gemini-1.5-pro, gemini-1.5-flash, gemini-1.5-flash-8b)
- Remove retired experimental 2.0 image gen models
- Fix default model from retired gemini-pro to gemini-2.5-flash
- Update docs, onboarding config, VSCode schema, GUI model picker, VertexAI provider
- Update isRecommendedAgentModel regex and tests

Fixes #10996, #10998

* fix: address review comments

- Add missing gemini-3.1-flash-image-preview to VS Code schema enum
- Tighten isRecommendedAgentModel regex to match 3-flash-preview (not bare 3-flash)
- Update case-insensitivity tests for new model names

* fix: fix misleading test description and inconsistent doc heading

- Rename test to "Gemini 3.1 Pro and 3 Flash Preview models" to match assertions
- Update chat.mdx heading from "Gemini 3 Pro" to "Gemini 3.1 Pro"
2026-03-24 20:22:47 -07:00
Varun Chawla
dc47a957d1 fix: check exclusions on both raw and normalized model names for LM Studio
The exclusion check only tested the lowercased model name, missing cases
where hyphenated names like "Mistral-Lite" normalize to "mistrallite"
which should match the exclusion pattern.
2026-02-08 10:09:33 -08:00
Varun Chawla
f83aeed254 fix: correct model ID normalization order for LM Studio
Check exclusions on both raw and normalized (hyphen-stripped) model
names before delegating to Ollama's heuristic. This ensures:

1. Hyphenated exclusions like "mistral-openorca" are caught on the raw name
2. Non-hyphenated variants like "MistralOpenOrca" are caught on the
   normalized name before the "mistral" support pattern matches
3. Hyphenated LM Studio IDs like "Meta-Llama-3.1-8B" still get detected
   via the normalized fallback to Ollama
2026-02-08 05:20:12 -08:00
Varun Chawla
71d355ec44 fix: normalize hyphenated model IDs for LM Studio tool support
LM Studio uses hyphenated model identifiers (e.g., "Meta-Llama-3.1-8B-Instruct-GGUF"),
but the Ollama heuristic checks for non-hyphenated patterns like "llama3.1".

This fix normalizes hyphenated model names by removing hyphens before delegating to
Ollama's tool support logic, enabling agent mode for LM Studio models with hyphenated IDs.

Added comprehensive tests for hyphenated model names including:
- Meta-Llama-3.1-8B-Instruct-GGUF
- Qwen2-7B-Instruct
- Mixtral-8x7B-Instruct-v0.1
- Case insensitivity checks
- Negative tests for unsupported models like "Llama-Vision-Free"

Addresses feedback from Cubic AI bot review.
2026-02-07 20:12:08 -08:00
Varun Chawla
be5181ef31 feat: enable agent mode support for LM Studio models
Add LM Studio to PROVIDER_TOOL_SUPPORT by referencing Ollama's
tool support implementation. LM Studio uses an OpenAI-compatible
API similar to Ollama, so the same model compatibility logic applies.

Fixes #5182
2026-02-07 15:16:51 -08:00
Dallin Romney
5908d184ca fix: tool support tests 2025-12-02 13:14:02 -08:00
Continue
ed0a6714ed test: add comprehensive tests for isRecommendedAgentModel function
Added tests for Gemini 3 Pro model recognition and other agent models.
Tests cover:
- OpenAI o1/o3/o4 models
- DeepSeek R1/Reasoner models
- Gemini 2.5 and 3.x Pro models (including new gemini-3-pro-preview)
- Claude Sonnet 3.7+ and Opus 4 models
- xAI Grok Code models
- Case insensitivity and edge cases

Co-authored-by: nate <nate@continue.dev>
2025-11-25 13:08:25 +00:00
Maxime Brunet
9525ea8794
feat(cohere): add support from Reasoning/Vision/Translate models 2025-11-04 20:25:44 -03:00
Dallin Romney
389664ddf5 fix: deprecate gemini 1.5 2025-10-01 10:46:51 -07:00
Dallin Romney
1e3bf050d2 feat: grok model additions 2025-09-23 14:08:17 -07:00
Dallin Romney
8444e83caf
Merge branch 'main' into feat/novita-tool-support 2025-08-22 12:00:40 -07:00
Suhas S
cbdd187bbb fix: disable tool support for moonshotai/kimi-k2:free model
Fixes #6619 where moonshotai/kimi-k2:free was causing 400 errors
in agent mode because it doesn't support tool calls.

This is a minimal, targeted fix that only affects the specific
model reported in the issue.
2025-08-15 21:20:53 +08:00
u-yuta
6e91e3845c test: add Novita provider tool support tests
Add comprehensive test coverage for Novita provider including exact
match models, prefix match models, and unsupported model cases.
2025-08-15 20:52:01 +09:00
Steven Kreitzer
812dbe9c00
feat: add gemma tool calling
Signed-off-by: Steven Kreitzer <skre@skre.me>
2025-07-25 10:40:32 -05:00
Maxime Brunet
c0174b6074
✨ add tool support to Cohere 2025-06-14 17:32:56 -03:00
Maxime Brunet
fbd0a9da51
🔧 refresh list of Cohere models 2025-06-14 17:13:15 -03:00
Nate
ade15bc7d6 Merge branch 'main' into nate/dev-data-updates 2025-05-25 18:53:32 -07:00
Nate
fb11c44575 update toolSupport and tests to always return a boolean. and for continue-proxy to expect full model string 2025-05-21 14:58:01 -07:00
Mathieu Santostefano
6c5441effd
Update toolSupport.test.ts to support devstral 2025-05-21 20:37:36 +02:00
Minipeps
00ccae0384 tests: add new llm and toolSupport tests for Mistral providers 2025-04-15 13:55:19 +02:00
chezsmithy
a3a5d08ceb avoid activating tools for claude haiku and opus 2025-03-01 20:56:10 -08:00
chezsmithy
be7f7a9baa feat-bedrock-tools-3.7 2025-03-01 20:39:08 -08:00