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
23 changes: 23 additions & 0 deletions src/api/providers/fetchers/__tests__/openrouter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,29 @@ describe("OpenRouter API", () => {
expect(result.contextWindow).toBe(128000)
})

it("sets horizon-beta model to 32k max tokens", () => {
const mockModel = {
name: "Horizon Beta",
description: "Test model",
context_length: 128000,
max_completion_tokens: 128000,
pricing: {
prompt: "0.000003",
completion: "0.000015",
},
}

const result = parseOpenRouterModel({
id: "openrouter/horizon-beta",
model: mockModel,
modality: "text",
maxTokens: 128000,
})

expect(result.maxTokens).toBe(32768)
expect(result.contextWindow).toBe(128000)
})

it("does not override max tokens for other models", () => {
const mockModel = {
name: "Other Model",
Expand Down
5 changes: 5 additions & 0 deletions src/api/providers/fetchers/openrouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,5 +237,10 @@ export const parseOpenRouterModel = ({
modelInfo.maxTokens = 32768
}

// Set horizon-beta model to 32k max tokens
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider consolidating these horizon model overrides to reduce duplication:

This would replace both the horizon-alpha block (lines 235-238) and horizon-beta block (lines 240-243).

if (id === "openrouter/horizon-beta") {
modelInfo.maxTokens = 32768
}

return modelInfo
}
Loading