mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-06 01:14:52 +01:00
zen: use gpt-5-nano as small model
This commit is contained in:
@@ -291,7 +291,7 @@ export async function handler(
|
|||||||
|
|
||||||
async function authenticate(modelInfo: ModelInfo, providerInfo: ProviderInfo) {
|
async function authenticate(modelInfo: ModelInfo, providerInfo: ProviderInfo) {
|
||||||
const apiKey = opts.parseApiKey(input.request.headers)
|
const apiKey = opts.parseApiKey(input.request.headers)
|
||||||
if (!apiKey) {
|
if (!apiKey || apiKey === "public") {
|
||||||
if (modelInfo.allowAnonymous) return
|
if (modelInfo.allowAnonymous) return
|
||||||
throw new AuthError("Missing API key.")
|
throw new AuthError("Missing API key.")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export namespace Provider {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
autoload: Object.keys(input.models).length > 0,
|
autoload: Object.keys(input.models).length > 0,
|
||||||
options: {},
|
options: hasKey ? {} : { apiKey: "public" },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
openai: async () => {
|
openai: async () => {
|
||||||
@@ -582,6 +582,9 @@ export namespace Provider {
|
|||||||
if (providerID === "github-copilot") {
|
if (providerID === "github-copilot") {
|
||||||
priority = priority.filter((m) => m !== "claude-haiku-4.5")
|
priority = priority.filter((m) => m !== "claude-haiku-4.5")
|
||||||
}
|
}
|
||||||
|
if (providerID === "opencode" || providerID === "local") {
|
||||||
|
priority = ["gpt-5-nano"]
|
||||||
|
}
|
||||||
for (const item of priority) {
|
for (const item of priority) {
|
||||||
for (const model of Object.keys(provider.info.models)) {
|
for (const model of Object.keys(provider.info.models)) {
|
||||||
if (model.includes(item)) return getModel(providerID, model)
|
if (model.includes(item)) return getModel(providerID, model)
|
||||||
|
|||||||
Reference in New Issue
Block a user