Fix not being able to use specific providers on Openrouter (#3354)

This commit is contained in:
Daniel 2025-05-08 21:50:23 -05:00 committed by hannesrudolph
parent 9dfe7e118d
commit 2cf6eb192d
2 changed files with 2 additions and 2 deletions

View file

@ -72,7 +72,7 @@ export async function getOpenRouterModels(options?: ApiHandlerOptions): Promise<
typeof cacheWritesPrice !== "undefined" && typeof cacheReadsPrice !== "undefined"
const modelInfo: ModelInfo = {
maxTokens: rawModel.top_provider?.max_completion_tokens,
maxTokens: 0,
contextWindow: rawModel.context_length,
supportsImages: rawModel.architecture?.modality?.includes("image"),
supportsPromptCache,

View file

@ -106,7 +106,7 @@ export class OpenRouterHandler extends BaseProvider implements SingleCompletionH
// https://openrouter.ai/docs/transforms
const completionParams: OpenRouterChatCompletionParams = {
model: modelId,
max_tokens: maxTokens,
...(maxTokens && maxTokens > 0 && { max_tokens: maxTokens }),
temperature,
thinking, // OpenRouter is temporarily supporting this.
top_p: topP,