PWA - patched deps
This commit is contained in:
12
src/lib/server/llm.ts
Normal file
12
src/lib/server/llm.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import OpenAI from 'openai';
|
||||
import { env } from '$env/dynamic/private';
|
||||
|
||||
export const createLLM = () => {
|
||||
// Detect if we are using Ollama or OpenAI based on URL
|
||||
const baseURL = env.OPENAI_BASE_URL;
|
||||
const client = new OpenAI({
|
||||
apiKey: env.OPENAI_API_KEY,
|
||||
baseURL: baseURL
|
||||
});
|
||||
return { client, model: env.LLM_MODEL || 'gpt-4o' };
|
||||
};
|
||||
Reference in New Issue
Block a user