import { OLLAMA_PORT } from "../config.js"; export function opencodeConfig(modelId: string, modelName: string): string { return JSON.stringify( { model: `ollama/${modelId}`, provider: { ollama: { npm: "@ai-sdk/openai-compatible", name: "Ollama (local)", options: { baseURL: `http://127.0.0.1:${OLLAMA_PORT}/v1`, apiKey: "not-needed", }, models: { [modelId]: { name: modelName, }, }, }, }, }, null, 2, ) + "\n"; }