Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/src/sync/providers/openrouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export function buildOpenRouterModel(
const reasoning_options = existing?.reasoning_options?.length
? existing.reasoning_options
: openRouterReasoningOptions(model.reasoning) ?? existing?.reasoning_options;
const context = model.top_provider.context_length ?? model.context_length;
const context = model.context_length;
const family = inferFamily(model, name);
const releaseDate = dateFromTimestamp(model.created);
const familyValue = existing?.family === "o" && family !== "o"
Expand Down
17 changes: 17 additions & 0 deletions packages/core/test/sync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,23 @@ test("syncs OpenRouter reasoning efforts from model metadata", () => {
});
});

test("uses OpenRouter model context when top provider reports a shorter context", () => {
const model = buildOpenRouterModel(openRouterModel({
context_length: 1_048_576,
top_provider: {
context_length: 32_000,
max_completion_tokens: 8_192,
},
}), undefined);

expect(model).toMatchObject({
limit: {
context: 1_048_576,
output: 8_192,
},
});
});

test("factors OpenRouter Pro routes against canonical OpenAI metadata", () => {
const model = buildOpenRouterModel(openRouterModel({
id: "openai/gpt-5.6-sol-pro",
Expand Down
3 changes: 0 additions & 3 deletions providers/openrouter/models/xiaomi/mimo-v2.5.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@ type = "toggle"
input = 0.105
output = 0.28
cache_read = 0.028

[limit]
context = 32_000
Loading