Commit 2f6319b
feat: Adds intelligent tiered model routing (#47)
* chore: move dockerode to optionalDependencies, wrap require
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Added tiered System
* Added docs
* Fix IDE client tool filtering and Codex CLI tool mappings
- Fix Codex Bash mapping: shell_command → shell (array format for command)
- Add missing Codex mappings: TodoWrite → update_plan, WebSearch → web_search
- Add two-layer tool filtering for IDE clients:
Layer 1: IDE_SAFE_TOOLS removes AskUserQuestion (can't work through proxy)
Layer 2: CLIENT_TOOL_MAPPINGS per-client filter ensures each client only
sees tools it supports (e.g. Codex gets 8, Claude Code gets 14)
- Add tool name mapping to chat/completions response paths (streaming + non-streaming)
- Add missing Claude Code tools: MultiEdit, LS, NotebookRead
- Inject filtered tools in openai-router.js before orchestrator call to
prevent providers from injecting full STANDARD_TOOLS
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Demote verbose operational logs from info→debug, fix tier config crash
- Demote 22 info→debug in openai-router.js (request previews, tool injection, streaming chunks, intermediate conversions)
- Demote 39 info→debug in databricks.js (tool injection, request construction, response parsing across all providers)
- Clean up orchestrator/index.js: consolidate Ollama conversational check (6→1 log), headroom compression (4→1), tool execution mode (4→1); remove 4 console.log artifacts and [CONTEXT_FLOW] scaffolding
- Fix tier config: change hard throw to graceful warn when TIER_* env vars missing (was crashing CI)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add pino-roll file logging and update production docs
Adds optional persistent log file rotation via pino-roll (LOG_FILE_ENABLED=true)
and expands the Structured Logging section in production.md with file logging
config, log level philosophy, and querying examples.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Sync Dockerfile, docker-compose.yml, and .env.example with all env vars
Adds missing sections to all config files: file logging (LOG_FILE_*),
rate limiting, policy, agents, token optimization, smart tool selection,
prompt/semantic cache, tiered routing, and provider configs (LM Studio,
Z.AI, Vertex AI). Adds /app/logs volume for persistent log rotation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* remove unused
* Added gpt
* Added latest ollama support
* increased token limit
* Fix duplicate tool calls
* feat: add Moonshot AI (Kimi) provider, fix routing bugs, update docs
- Add Moonshot AI as first-class provider (invokeMoonshot, config, orchestrator, provider discovery)
- Fix stop_reason detection: check tool_calls presence instead of finish_reason string
- Fix streaming format mismatch: force non-streaming for OpenAI-format providers
- Fix reasoning content handling: use content field, fallback to reasoning_content
- Fix orchestrator double-conversion for Moonshot responses
- Fix force-local routing to respect TIER_SIMPLE config instead of hardcoding Ollama
- Remove dead code: determineProviderSync (unused sync routing fallback)
- Update routing docs: clear precedence hierarchy for TIER_* vs MODEL_PROVIDER vs PREFER_OLLAMA
- Add comprehensive Moonshot documentation across all doc files
- Add Moonshot to model-tiers.json (kimi-k2-thinking for REASONING tier)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: update tests to use determineProviderSmart after removing determineProviderSync
Replace all determineProviderSync() calls in tests with async
determineProviderSmart() since the sync function was removed as dead code.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: resolve undefined variable errors (logger in router, clean in orchestrator)
- Add missing logger require in src/api/router.js (used in streaming error handling)
- Fix clean.model → cleanPayload.model in orchestrator hybrid mode response
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Result
---------
Co-authored-by: vishal veerareddy <vishalveera.reddy@servicenow.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 4562795 commit 2f6319b
61 files changed
Lines changed: 5643 additions & 1557 deletions
File tree
- .claude
- config
- docs
- documentation
- scripts
- src
- api
- middleware
- budget
- clients
- config
- logger
- orchestrator
- routing
- sessions
- tools
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
81 | 92 | | |
82 | 93 | | |
83 | 94 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
79 | 88 | | |
80 | 89 | | |
81 | 90 | | |
82 | 91 | | |
83 | 92 | | |
84 | | - | |
| 93 | + | |
85 | 94 | | |
86 | | - | |
87 | | - | |
| 95 | + | |
| 96 | + | |
88 | 97 | | |
| 98 | + | |
89 | 99 | | |
90 | 100 | | |
91 | 101 | | |
| |||
99 | 109 | | |
100 | 110 | | |
101 | 111 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | 112 | | |
106 | 113 | | |
107 | | - | |
| 114 | + | |
| 115 | + | |
108 | 116 | | |
109 | 117 | | |
110 | | - | |
111 | | - | |
112 | 118 | | |
113 | 119 | | |
114 | 120 | | |
115 | 121 | | |
116 | 122 | | |
117 | | - | |
| 123 | + | |
| 124 | + | |
118 | 125 | | |
119 | 126 | | |
120 | | - | |
121 | 127 | | |
122 | 128 | | |
123 | 129 | | |
124 | 130 | | |
125 | | - | |
| 131 | + | |
126 | 132 | | |
127 | 133 | | |
128 | 134 | | |
129 | 135 | | |
130 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
131 | 142 | | |
132 | 143 | | |
133 | 144 | | |
134 | 145 | | |
135 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
136 | 156 | | |
137 | | - | |
138 | | - | |
139 | 157 | | |
140 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
141 | 205 | | |
142 | 206 | | |
143 | 207 | | |
| |||
160 | 224 | | |
161 | 225 | | |
162 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
163 | 255 | | |
164 | 256 | | |
165 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
| 280 | + | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
0 commit comments