@thxp/llms 3.2.6 → 3.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/cjs/server.cjs +109 -109
- package/dist/cjs/server.cjs.map +3 -3
- package/dist/esm/server.mjs +109 -109
- package/dist/esm/server.mjs.map +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
## ✨ Features
|
|
23
23
|
|
|
24
|
-
- **Model Routing**: Route requests to different models based on your needs (e.g., background
|
|
24
|
+
- **Model Routing**: Route requests to different models based on your needs (e.g., background, thinking, web search).
|
|
25
25
|
- **Multi-Provider Support**: Supports various model providers like OpenRouter, DeepSeek, Ollama, Gemini, Volcengine, and SiliconFlow.
|
|
26
26
|
- **Request/Response Transformation**: Customize requests and responses for different providers using transformers.
|
|
27
27
|
- **Dynamic Model Switching**: Switch models on-the-fly within Claude Code using the `/model` command.
|
|
@@ -437,17 +437,17 @@ You can also create your own transformers and load them via the `transformers` f
|
|
|
437
437
|
|
|
438
438
|
#### Router
|
|
439
439
|
|
|
440
|
-
The `Router` object defines which model to use for different scenarios:
|
|
440
|
+
The `Router` object defines which model to use for different scenarios. All requests start with the `default` model, and are overridden when specific conditions are met:
|
|
441
441
|
|
|
442
|
-
- `default`: The default model for
|
|
443
|
-
- `background`:
|
|
444
|
-
- `think`:
|
|
445
|
-
- `webSearch`:
|
|
446
|
-
- `image` (beta):
|
|
442
|
+
- `default`: The default model for all requests (array supported for fallback chain).
|
|
443
|
+
- `background`: Overrides for Haiku model requests only (model name contains "claude" and "haiku"). Useful for routing lightweight Haiku tasks to a cheaper model.
|
|
444
|
+
- `think`: Overrides when thinking is explicitly enabled (thinking: true or type: "enabled"). Adaptive thinking does not trigger this route.
|
|
445
|
+
- `webSearch`: Overrides when actual web search tool calls are detected in the conversation history (not just because the WebSearch tool is available).
|
|
446
|
+
- `image` (beta): Overrides for image-related tasks (requires model to support tool calling; set config.forceUseImageAgent to true if not).
|
|
447
447
|
|
|
448
448
|
- You can also switch models dynamically in Claude Code with the `/model` command:
|
|
449
449
|
`/model provider_name,model_name`
|
|
450
|
-
Example: `/model openrouter,anthropic/claude-3.5-sonnet`
|
|
450
|
+
Example: `/model openrouter,anthropic/claude-3.5-sonnet`
|
|
451
451
|
|
|
452
452
|
#### Custom Router
|
|
453
453
|
|