- it seems easy to replace ollama with lm studio by updating
src/app/api/generate/route.ts like below
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
} else if (process.env.USE_OLLAMA === "true") {
// const ollama = createOllama({
// baseURL: process.env.OLLAMA_API_URL || "http://localhost:11434/api",
// });
const ollama = createOpenAICompatible({
name: 'lmstudio',
baseURL: process.env.OLLAMA_API_URL || 'http://localhost:1234/v1',
supportsStructuredOutputs: true,
});
model = ollama(process.env.MODEL_NAME || "gpt-oss:120b-cloud");
}
- but no response from llm. I cannot figure it out 🤔
- Could you please add support for lm studio?
src/app/api/generate/route.tslike below