Skip to content

A self-improving RLM agent for coding workflows and long-running autonomous tasks.

Rust

chore(ai): improve generator comments (#700)

JannikSt0e0d23391bcd
diff --git a/packages/ai/scripts/generate-models.ts b/packages/ai/scripts/generate-models.ts
index 150e438d17..18d9e93494 100644
--- a/packages/ai/scripts/generate-models.ts
+++ b/packages/ai/scripts/generate-models.ts
@@ -135,20 +135,19 @@ interface PrimeInferenceModelMetadata {
}
// The full Prime Inference catalog is registered (minus raw/duplicate variants).
-// The /models endpoint publishes pricing only, so context/output limits and
-// modalities come from the OpenRouter catalog, which Prime routes most models
-// through. Entries here override OpenRouter where the Prime route enforces a
-// different limit (verified against the live API) or fill gaps for models
-// OpenRouter does not list or leaves incomplete.
+// Prime's /models endpoint publishes pricing only, so context/output limits and
+// modalities are read from OpenRouter's public catalog, used here purely as a
+// published spec sheet for the same upstream models — requests always go to
+// Prime's own baseUrl. Entries below override those specs where the Prime route
+// enforces a different limit (verified against the live API) or fill gaps for
+// models OpenRouter does not list or leaves incomplete.
const PRIME_INFERENCE_MODEL_METADATA: Record<string, PrimeInferenceModelMetadata> = {
- // Verified 2026-07-08: these routes reject prompts above 200k tokens even
- // though OpenRouter reports 1M. Every other Claude route accepted a >200k
- // prompt (opus-4.7/4.8, sonnet-4.6/5, fable-5 verified individually).
+ // These routes accept 200k, checked against the live API 2026-07-08. The
+ // other Claude routes take the full window their spec lists.
"anthropic/claude-sonnet-4": { contextWindow: 200000 },
"anthropic/claude-sonnet-4.5": { contextWindow: 200000 },
- // Enforced windows measured against the live gateway 2026-07-08 where they
- // are SMALLER than OpenRouter's listing — over-declaring breaks context
- // tracking. (Measured by binary-searching the max_tokens reject boundary.)
+ // Windows confirmed against the live API 2026-07-08 where they are SMALLER
+ // than the published spec — over-declaring breaks context tracking.
"meta-llama/llama-3.2-1b-instruct": { contextWindow: 60000 },
"meta-llama/llama-3.2-3b-instruct": { contextWindow: 80000 },
"minimax/minimax-m3": { contextWindow: 524288 },
diff --git a/packages/ai/test/prime-inference-models.test.ts b/packages/ai/test/prime-inference-models.test.ts
index a52fc21cb6..f28ac159aa 100644
--- a/packages/ai/test/prime-inference-models.test.ts
+++ b/packages/ai/test/prime-inference-models.test.ts
@@ -94,9 +94,10 @@ describe("Prime Inference models", () => {
expect(gemini.input).toEqual(["text", "image"]);
expect(gemini.reasoning).toBe(true);
- // Modality and reasoning come from OpenRouter, but the Prime route enforces
- // a smaller window and output cap than OpenRouter lists (1M/16k), so the
- // curated override wins for contextWindow and maxTokens.
+ // Modality and reasoning are read from OpenRouter's published spec for the
+ // same upstream model, but the Prime route enforces a smaller window and
+ // output cap than that spec lists (1M/16k), so the curated override wins
+ // for contextWindow and maxTokens.
const nemotronSuper = getModel("prime-inference", "nvidia/nemotron-3-super-120b-a12b");
expect(nemotronSuper.reasoning).toBe(true);
expect(nemotronSuper.input).toEqual(["text"]);
@@ -199,8 +200,8 @@ describe("Prime Inference models", () => {
expect(getModel("prime-inference", "anthropic/claude-sonnet-4.6").contextWindow).toBe(1000000);
expect(getModel("prime-inference", "anthropic/claude-sonnet-5").contextWindow).toBe(1000000);
expect(getModel("prime-inference", "anthropic/claude-haiku-4.5").contextWindow).toBe(200000);
- // Empirically verified: this route rejects prompts above 200k tokens even
- // though OpenRouter reports 1M for the upstream model.
+ // Confirmed against the live API: this route serves a 200k window, not the
+ // larger one the upstream model's published spec lists.
expect(getModel("prime-inference", "anthropic/claude-sonnet-4.5").contextWindow).toBe(200000);
});