coderouter-cli 1.8.0__py3-none-any.whl → 1.8.1__py3-none-any.whl

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.
@@ -49,8 +49,35 @@ def load_config(path: str | os.PathLike[str] | None = None) -> CodeRouterConfig:
49
49
  # fail can be rescued by an explicit env-set mode, and (b) the model-
50
50
  # validator's "default_profile must exist in profiles" check applies to the
51
51
  # *effective* mode the engine will see, not the pre-override YAML value.
52
+ #
53
+ # v1.8.0+: also resolve env_mode through ``mode_aliases`` before assigning,
54
+ # so that startup-time ``--mode coding`` (env CODEROUTER_MODE=coding)
55
+ # behaves symmetrically with the runtime ``X-CodeRouter-Mode: coding``
56
+ # header — both should accept short intent names like ``coding`` /
57
+ # ``general`` / ``reasoning`` and resolve them to the underlying profile
58
+ # (e.g. ``claude-code-nim`` in providers.nvidia-nim.yaml). Without this,
59
+ # users on the NIM example yaml hit
60
+ # "default_profile 'coding' is not declared in profiles:
61
+ # known=['claude-code-nim', ...]"
62
+ # because mode_aliases only fired at request time, not at startup.
52
63
  env_mode = os.environ.get("CODEROUTER_MODE", "").strip()
53
64
  if env_mode:
65
+ # Pre-validation alias resolution: if env_mode isn't directly a
66
+ # profile name but matches an entry in raw["mode_aliases"], swap it
67
+ # for the underlying profile name. This avoids forcing every example
68
+ # yaml to mirror the v1.8.0 four-profile names (multi/coding/general
69
+ # /reasoning) just to accept the canonical short --mode flags.
70
+ raw_profiles = raw.get("profiles", []) or []
71
+ profile_names = {
72
+ p.get("name") for p in raw_profiles if isinstance(p, dict)
73
+ }
74
+ raw_aliases = raw.get("mode_aliases", {}) or {}
75
+ if (
76
+ env_mode not in profile_names
77
+ and isinstance(raw_aliases, dict)
78
+ and env_mode in raw_aliases
79
+ ):
80
+ env_mode = raw_aliases[env_mode]
54
81
  raw["default_profile"] = env_mode
55
82
 
56
83
  config = CodeRouterConfig.model_validate(raw)
@@ -168,26 +168,36 @@ rules:
168
168
  claude_code_suitability: ok
169
169
 
170
170
  # ------------------------------------------------------------------
171
- # Qwen3.6 family (v1.7-B 追加)
171
+ # Qwen3.6 family (v1.7-B 追加、v1.8.1 で suitability 撤回)
172
172
  #
173
173
  # 2026-04 リリースの Qwen3.6 シリーズ。Ollama 公式 tag は
174
- # qwen3.6:27b / qwen3.6:35b、全 variant tools+vision+thinking 対応、
175
- # 256K contextnote 記事 (r/LocalLLaMA 2026-04 Megathread) で
176
- # 「Claude Code 代替として最高」「local champ」と評価。
177
- # Qwen3-Coder と並んで Claude Sonnet 互換性が高い。
174
+ # qwen3.6:27b / qwen3.6:35b、metadata 上は tools+vision+thinking 対応、
175
+ # 256K context を宣言。note 記事 (r/LocalLLaMA 2026-04 Megathread) で
176
+ # 「Claude Code 代替として最高」「local champ」と評価されている。
177
+ #
178
+ # ただし v1.8.0 までで `claude_code_suitability: ok` を declare していた
179
+ # のは note 記事の伝聞ベースの先回り宣言で、v1.8.1 (2026-04-26) の
180
+ # 実機検証 (M3 Max 32GB / Ollama 0.21.2) で次の課題が判明:
181
+ # - num_ctx を declare 32768 しても Ollama 側で silent に縮められる
182
+ # (canary echo-back probe 失敗)
183
+ # - tool_calls probe が native tool_calls / 修復可能 JSON のいずれも
184
+ # 返さず NEEDS_TUNING
185
+ # - streaming probe が finish_reason='length' で 0 chars 打ち切り
186
+ # これらは Ollama 経由特有の問題で、HF / vLLM 直接ロードなら違う可能性。
187
+ # 確証ない以上、`claude_code_suitability` は撤回し `tools` 宣言だけ残す。
188
+ # 実機で動いたユーザーは `~/.coderouter/model-capabilities.yaml` で
189
+ # `claude_code_suitability: ok` を上書きできる。
178
190
  # ------------------------------------------------------------------
179
191
 
180
192
  - match: "qwen3.6:*"
181
193
  kind: openai_compat
182
194
  capabilities:
183
195
  tools: true
184
- claude_code_suitability: ok
185
196
 
186
197
  - match: "qwen/qwen3.6-*"
187
198
  kind: openai_compat
188
199
  capabilities:
189
200
  tools: true
190
- claude_code_suitability: ok
191
201
 
192
202
  # ------------------------------------------------------------------
193
203
  # Gemma 4 family (v1.7-B 追加)
@@ -233,3 +243,99 @@ rules:
233
243
  kind: openai_compat
234
244
  capabilities:
235
245
  tools: true
246
+
247
+ # ------------------------------------------------------------------
248
+ # Kimi K2 family (Moonshot AI、v1.8.0 追加)
249
+ #
250
+ # NVIDIA NIM 経由で実機検証済み (2026-04-23) の tool-capable モデル。
251
+ # examples/providers.nvidia-nim.yaml の `nim-kimi-k2` / `nim-kimi-k2-thinking`
252
+ # で運用実績あり。Unsloth tool-calling guide にも tool calling 対応モデル
253
+ # として掲載 (Kimi K2.5 / K2 Thinking)。providers.yaml 側で個別の
254
+ # `capabilities.tools: true` 宣言を省略可能にするのが目的。
255
+ # ------------------------------------------------------------------
256
+
257
+ - match: "moonshotai/kimi-k2*"
258
+ kind: openai_compat
259
+ capabilities:
260
+ tools: true
261
+
262
+ - match: "moonshotai/Kimi-K2*"
263
+ kind: openai_compat
264
+ capabilities:
265
+ tools: true
266
+
267
+ # ------------------------------------------------------------------
268
+ # gpt-oss family (OpenAI 117B MoE オープンウェイト、v1.8.0 追加)
269
+ #
270
+ # OpenRouter free 経由で実機検証済み (`openai/gpt-oss-120b:free` を
271
+ # examples/providers.yaml の `openrouter-gpt-oss-free` で運用)。
272
+ # native tool calling 設計、131K context、Unsloth tool-calling guide
273
+ # にも tool calling 対応モデルとして掲載 (gpt-oss)。
274
+ # ------------------------------------------------------------------
275
+
276
+ - match: "openai/gpt-oss-*"
277
+ kind: openai_compat
278
+ capabilities:
279
+ tools: true
280
+
281
+ - match: "gpt-oss-*"
282
+ kind: openai_compat
283
+ capabilities:
284
+ tools: true
285
+
286
+ # ------------------------------------------------------------------
287
+ # 先回り宣言 family (Unsloth tool-calling guide 掲載、v1.8.0 追加)
288
+ #
289
+ # Unsloth のローカル LLM tool-calling ガイド
290
+ # (https://unsloth.ai/docs/jp/ji-ben/tool-calling-guide-for-local-llms)
291
+ # で tool-calling 対応モデルとして掲載されているが、CodeRouter 側で
292
+ # 実機検証は未実施。tools=true の事前宣言だけ入れて、providers.yaml で
293
+ # これらを使う際の `capabilities.tools: true` 明示宣言を不要にする。
294
+ # claude_code_suitability は実機検証後に追加判断 — それまでは "意見なし"。
295
+ # 不具合があれば user-side の `~/.coderouter/model-capabilities.yaml` で
296
+ # `tools: false` を declare して上書き可能 (first-match-per-flag)。
297
+ # ------------------------------------------------------------------
298
+
299
+ # DeepSeek-V3.x — DeepSeek-AI の主力 (V3.1 / V3.2 等)
300
+ - match: "deepseek-ai/DeepSeek-V3*"
301
+ kind: openai_compat
302
+ capabilities:
303
+ tools: true
304
+
305
+ - match: "deepseek/deepseek-v3*"
306
+ kind: openai_compat
307
+ capabilities:
308
+ tools: true
309
+
310
+ # MiniMax — MiniMaxAI の MoE 系
311
+ - match: "MiniMaxAI/MiniMax-*"
312
+ kind: openai_compat
313
+ capabilities:
314
+ tools: true
315
+
316
+ - match: "minimax/minimax-*"
317
+ kind: openai_compat
318
+ capabilities:
319
+ tools: true
320
+
321
+ # NVIDIA Nemotron 3 — Nano 系の小型モデル
322
+ - match: "nvidia/nemotron-3-*"
323
+ kind: openai_compat
324
+ capabilities:
325
+ tools: true
326
+
327
+ - match: "nvidia/Nemotron-3-*"
328
+ kind: openai_compat
329
+ capabilities:
330
+ tools: true
331
+
332
+ # Devstral 2 — Mistral AI の coding 特化 fine-tune
333
+ - match: "mistralai/Devstral-*"
334
+ kind: openai_compat
335
+ capabilities:
336
+ tools: true
337
+
338
+ - match: "mistral/devstral*"
339
+ kind: openai_compat
340
+ capabilities:
341
+ tools: true
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: coderouter-cli
3
- Version: 1.8.0
3
+ Version: 1.8.1
4
4
  Summary: Local-first, free-first, fallback-built-in LLM router. Claude Code / OpenAI compatible.
5
5
  Project-URL: Homepage, https://github.com/zephel01/CodeRouter
6
6
  Project-URL: Repository, https://github.com/zephel01/CodeRouter
@@ -16,10 +16,10 @@ coderouter/adapters/registry.py,sha256=Syt3eDljWZAK5mfiJGvUMKaZYAfCRScp7PvV6pYt7
16
16
  coderouter/config/__init__.py,sha256=FODEn74fN-qZnt4INPSHswqhOlEgpL6-_onxsitSx8g,274
17
17
  coderouter/config/capability_registry.py,sha256=oypl6Z-YjvNoC87AdSIm1C7XE_MZoFq_7Ivm3eRH3cI,14379
18
18
  coderouter/config/env_file.py,sha256=CoMK27fuAXm-NtoLzXb8yN2E-wDFjHQuFwiIlmgTBQw,10356
19
- coderouter/config/loader.py,sha256=MIrUDfK8JfrWZqrMa1R8MFX1-A9sflwOCQq-hz7oVc4,2614
19
+ coderouter/config/loader.py,sha256=FUEe8m4Tnmj_aul0vSctD8vKvNW-oLRoMRbTpSKqSmc,4077
20
20
  coderouter/config/schemas.py,sha256=NMWKstAzDKc6DT7qKr-GKlUFrsfE4HtEG7zkz9Pnq78,21597
21
21
  coderouter/data/__init__.py,sha256=uNyfD9jaCvTWsBAWtaw1Fr25OSxzv3psGMfBjT1z0Cc,328
22
- coderouter/data/model-capabilities.yaml,sha256=Z-mCubuwvfJa_Uw7M8PL9B1F-ojy1ulVgd6-fQtPjbU,9771
22
+ coderouter/data/model-capabilities.yaml,sha256=8g11ysbjEwt9Rc9Q9o4VCA0de2RmnH-mJEbnsueET_A,13949
23
23
  coderouter/ingress/__init__.py,sha256=WQsCH2CGJCAhy0mS6GSEdeYZRkkQu2OHDsP4CJWTLug,155
24
24
  coderouter/ingress/anthropic_routes.py,sha256=vuylsn7klFN-Dz3cBS7LrhnnSRGr6agipgMrr9gxq7k,8261
25
25
  coderouter/ingress/app.py,sha256=b9s6NpBGckaTQJCaw-6MZaY7Eq3rxgtX_cCkgWq-0Ig,6620
@@ -37,8 +37,8 @@ coderouter/translation/__init__.py,sha256=PYXN7XVEwpG1uC8RLy6fvnGbzEZhhrEuUapH8I
37
37
  coderouter/translation/anthropic.py,sha256=JpvIWNXHUPVqOGvps7o_6ZADhXuJuvpU7RdMqQFtwwM,6421
38
38
  coderouter/translation/convert.py,sha256=-qyzFzmmr9hhQV6_Sg75kJnvCZvHe3n7vRdaZtk_JqQ,47269
39
39
  coderouter/translation/tool_repair.py,sha256=fyxDb4kWHytO5JWq5y0i4tinJUtWqhMCkyfoCf5BjeM,8314
40
- coderouter_cli-1.8.0.dist-info/METADATA,sha256=JMAdfoBKRz0Igv2bNLc2bKTS3-E__qT3yGRRbiHcMjQ,44136
41
- coderouter_cli-1.8.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
42
- coderouter_cli-1.8.0.dist-info/entry_points.txt,sha256=-dnLfD1YZ2WjH2zSdNCvlO65wYltM9bsHt9Fhg3yGss,51
43
- coderouter_cli-1.8.0.dist-info/licenses/LICENSE,sha256=wkEzoR86jFw33jvfOHjULqmkGEfxTFMgMaJnpR8mPRw,1065
44
- coderouter_cli-1.8.0.dist-info/RECORD,,
40
+ coderouter_cli-1.8.1.dist-info/METADATA,sha256=sb0tldZ1vqseJCuO-oExjVXwnmOslwQt9MN9Rh5PVS8,44136
41
+ coderouter_cli-1.8.1.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
42
+ coderouter_cli-1.8.1.dist-info/entry_points.txt,sha256=-dnLfD1YZ2WjH2zSdNCvlO65wYltM9bsHt9Fhg3yGss,51
43
+ coderouter_cli-1.8.1.dist-info/licenses/LICENSE,sha256=wkEzoR86jFw33jvfOHjULqmkGEfxTFMgMaJnpR8mPRw,1065
44
+ coderouter_cli-1.8.1.dist-info/RECORD,,