@prestyj/core 5.30.0 → 5.30.2

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.
@@ -130,9 +130,10 @@ var USAGE_EXHAUSTED_DEFAULT_MS = 15 * 60 * 1e3;
130
130
  // src/model-registry.ts
131
131
  var MODELS = [
132
132
  // ── Anthropic ──────────────────────────────────────────
133
- // NOTE: Claude Mythos 5 (`claude-mythos-5`) is kept commented out — it's a
134
- // Project Glasswing (limited, invitation-only) model unavailable to most
135
- // users. Re-enable once it's generally available.
133
+ // NOTE: Claude Mythos 5.1 (`claude-mythos-5-1`, 2026-09-01) is kept commented
134
+ // out — it's a Project Glasswing model, still "Active (invite only)" in
135
+ // Anthropic's docs and unavailable to most users. Re-enable once it's
136
+ // generally available.
136
137
  {
137
138
  // Released 2026-09-01 — replaces Fable 5 at the same $10/$50 MTok (cache
138
139
  // reads drop to $0.25). Always-on adaptive thinking steered by effort;
@@ -154,8 +155,8 @@ var MODELS = [
154
155
  // // Mythos-class model offered through Project Glasswing (limited
155
156
  // // availability, invitation-only). Same underlying model as Fable 5.1 with
156
157
  // // some safeguards lifted; kept here so approved accounts can select it.
157
- // id: "claude-mythos-5",
158
- // name: "Claude Mythos 5",
158
+ // id: "claude-mythos-5-1",
159
+ // name: "Claude Mythos 5.1",
159
160
  // provider: "anthropic",
160
161
  // contextWindow: 1_000_000,
161
162
  // maxOutputTokens: 128_000,
@@ -222,16 +223,24 @@ var MODELS = [
222
223
  maxThinkingLevel: "max"
223
224
  },
224
225
  {
225
- id: "claude-haiku-4-5-20251001",
226
- name: "Claude Haiku 4.5",
226
+ // Released 2026-10-07 — replaces Haiku 4.5 at $0.10/$0.50 MTok (prompts
227
+ // up to 100K tokens; $0.50/$2.50 above). 1M context, 128K output, image
228
+ // input. Adaptive thinking with the full effort ladder (low→max, xhigh
229
+ // included; API default `medium`) — manual budget_tokens, non-default
230
+ // sampling params and assistant prefill all 400. No server-side refusal
231
+ // fallback: `fallbacks: "default"` is accepted but a refusal stays a
232
+ // refusal. Haiku 4.5 is retired here — a session that still has it saved
233
+ // falls back to the provider default on next start.
234
+ id: "claude-haiku-5-5",
235
+ name: "Claude Haiku 5.5",
227
236
  provider: "anthropic",
228
- contextWindow: 2e5,
229
- maxOutputTokens: 64e3,
237
+ contextWindow: 1e6,
238
+ maxOutputTokens: 128e3,
230
239
  supportsThinking: true,
231
240
  supportsImages: true,
232
241
  supportsVideo: false,
233
242
  costTier: "low",
234
- maxThinkingLevel: "high"
243
+ maxThinkingLevel: "max"
235
244
  },
236
245
  // ── OpenAI (Codex) ─────────────────────────────────────
237
246
  {
@@ -521,6 +530,25 @@ var MODELS = [
521
530
  costTier: "medium",
522
531
  maxThinkingLevel: "high"
523
532
  },
533
+ // K2.7 Code HighSpeed — the same model as K2.7 Code served at ~180 tok/s
534
+ // (up to ~260 on short contexts), 256K context (platform.kimi.ai model list,
535
+ // 2026-10-08). The `kimi-k2.7-code` prefix gives it K2.7's always-thinking
536
+ // wire handling in @prestyj/ai. The Kimi For Coding endpoint lists this model as
537
+ // `kimi-for-coding-highspeed`; like `kimi-k2.7-code` and `kimi-k3`, we send
538
+ // the public id there too.
539
+ {
540
+ id: "kimi-k2.7-code-highspeed",
541
+ name: "Kimi K2.7 Code HighSpeed",
542
+ provider: "moonshot",
543
+ contextWindow: 262144,
544
+ maxOutputTokens: 262144,
545
+ supportsThinking: true,
546
+ supportsImages: true,
547
+ supportsVideo: true,
548
+ maxVideoBytes: 100 * 1024 * 1024,
549
+ costTier: "medium",
550
+ maxThinkingLevel: "high"
551
+ },
524
552
  // ── Z.AI (GLM) ─────────────────────────────────────────
525
553
  // Two GLM entries, both live on the coding endpoint (verified against its
526
554
  // /models list). The pre-5.3 ids stay retired: they routed to strictly worse
@@ -712,23 +740,47 @@ var MODELS = [
712
740
  // billing follows each backend's rates on the HF account (small free tier).
713
741
  // Model ids are Hub repo paths, so they intentionally contain a slash — the
714
742
  // same shape local/ vLLM ids already use (`local/vllm/Qwen/Qwen3-32B`).
715
- {
716
- // Qwen's open flagship for agentic coding — tool-calling native, non-thinking
717
- // (the Coder line dropped the <think> block). 262K native context (1M needs
718
- // YaRN, which the router doesn't apply), 131K max output. :auto suffix lets
719
- // HF pick the backend with capacity; we keep the bare repo id so the picker
720
- // matches what GET /v1/models reports.
721
- id: "Qwen/Qwen3-Coder-480B-A35B-Instruct",
722
- name: "Qwen3 Coder 480B",
743
+ // Live GET /v1/models (2026-10-08) is the source for hosts, context and
744
+ // modalities. Qwen3 Coder 480B is retired here: only one tool-calling host
745
+ // (Novita) still served it. We keep bare repo ids (no :auto suffix) so the
746
+ // picker matches what GET /v1/models reports.
747
+ {
748
+ // Moonshot's open coding model. Served with tool calling by Novita and
749
+ // DeepInfra at 262K context, with image input (video is a Moonshot-API-only
750
+ // upload path). It always thinks, but the router has no documented effort
751
+ // control for it, so we register it as non-thinking: we never send a
752
+ // reasoning_effort that a host might reject. Output is capped at half the
753
+ // window so the input keeps room.
754
+ id: "moonshotai/Kimi-K2.7-Code",
755
+ name: "Kimi K2.7 Code",
723
756
  provider: "huggingface",
724
757
  contextWindow: 262144,
725
758
  maxOutputTokens: 131072,
726
759
  supportsThinking: false,
727
- supportsImages: false,
760
+ supportsImages: true,
728
761
  supportsVideo: false,
729
762
  costTier: "medium",
730
763
  maxThinkingLevel: "low"
731
764
  },
765
+ {
766
+ // DeepSeek V4.1 Flash open weights: 1M context and image input on four
767
+ // tool-calling hosts (Novita, Fireworks, Baseten, DeepInfra; $0.20–0.30 in /
768
+ // $0.60–1.20 out per MTok). It is listed before gpt-oss so it becomes the
769
+ // low-tier summary model, because its 1M window can take a full long
770
+ // session. Thinking control over the router is unverified, so it is
771
+ // registered as non-thinking. Output is a conservative 131K: hosts don't
772
+ // publish the 384K first-party cap.
773
+ id: "deepseek-ai/DeepSeek-V4.1-Flash",
774
+ name: "DeepSeek V4.1 Flash",
775
+ provider: "huggingface",
776
+ contextWindow: 1048576,
777
+ maxOutputTokens: 131072,
778
+ supportsThinking: false,
779
+ supportsImages: true,
780
+ supportsVideo: false,
781
+ costTier: "low",
782
+ maxThinkingLevel: "low"
783
+ },
732
784
  {
733
785
  // OpenAI's open-weight 120B MoE (5.1B active) — general-purpose, tool-calling
734
786
  // native, adjustable reasoning effort (low/medium/high, default medium) over
@@ -781,23 +833,30 @@ function getVideoByteLimit(modelId) {
781
833
  if (!model?.supportsVideo) return void 0;
782
834
  return model.maxVideoBytes ?? DEFAULT_MAX_VIDEO_BYTES;
783
835
  }
836
+ var DEFAULT_MODEL_IDS = {
837
+ xiaomi: "mimo-v2.6-pro",
838
+ openai: "gpt-6.1-sol",
839
+ gemini: "gemini-3.1-flash-lite",
840
+ glm: "glm-5.3",
841
+ moonshot: "kimi-k3",
842
+ minimax: "MiniMax-M3",
843
+ deepseek: "deepseek-v4-pro",
844
+ huggingface: "moonshotai/Kimi-K2.7-Code",
845
+ openrouter: "qwen/qwen3.8-max",
846
+ sakana: "fugu",
847
+ xai: "grok-4.7"
848
+ };
849
+ var FALLBACK_DEFAULT_MODEL_ID = "claude-sonnet-5-5";
850
+ function registeredModel(id) {
851
+ const model = MODELS.find((m) => m.id === id);
852
+ if (!model) throw new Error(`Default model "${id}" is not in the model registry`);
853
+ return model;
854
+ }
784
855
  function getDefaultModel(provider) {
785
- if (provider === "xiaomi") return MODELS.find((m) => m.id === "mimo-v2.6-pro");
786
- if (provider === "openai") return MODELS.find((m) => m.id === "gpt-6.1-sol");
787
- if (provider === "gemini") return MODELS.find((m) => m.id === "gemini-3.1-flash-lite");
788
- if (provider === "glm") return MODELS.find((m) => m.id === "glm-5.3");
789
- if (provider === "moonshot") return MODELS.find((m) => m.id === "kimi-k3");
790
- if (provider === "minimax") return MODELS.find((m) => m.id === "MiniMax-M3");
791
- if (provider === "deepseek") return MODELS.find((m) => m.id === "deepseek-v4-pro");
792
- if (provider === "huggingface")
793
- return MODELS.find((m) => m.id === "Qwen/Qwen3-Coder-480B-A35B-Instruct");
794
- if (provider === "openrouter") return MODELS.find((m) => m.id === "qwen/qwen3.8-max");
795
- if (provider === "sakana") return MODELS.find((m) => m.id === "fugu");
796
- if (provider === "xai") return MODELS.find((m) => m.id === "grok-4.7");
797
856
  if (provider === "local") {
798
857
  return getModelsForProvider("local")[0] ?? PLACEHOLDER_LOCAL_MODEL;
799
858
  }
800
- return MODELS.find((m) => m.id === "claude-sonnet-5-5");
859
+ return registeredModel(DEFAULT_MODEL_IDS[provider] ?? FALLBACK_DEFAULT_MODEL_ID);
801
860
  }
802
861
  var PLACEHOLDER_LOCAL_MODEL = {
803
862
  id: "local/none/none",