From 15bf9475fb5e962231dc6e822c27c76c182e0cd3 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Sun, 15 Mar 2026 12:10:13 -0500 Subject: [PATCH] fix(agent): register Ollama directly with api: openai-completions Pi SDK requires an api field on provider/model registration. Ollama uses the OpenAI-compatible completions API. Register directly via registry.registerProvider instead of the generic wrapper to pass the correct api type. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/gateway/src/agent/provider.service.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/gateway/src/agent/provider.service.ts b/apps/gateway/src/agent/provider.service.ts index 9b84df3..8c73fe6 100644 --- a/apps/gateway/src/agent/provider.service.ts +++ b/apps/gateway/src/agent/provider.service.ts @@ -92,15 +92,16 @@ export class ProviderService implements OnModuleInit { .map((modelId: string) => modelId.trim()) .filter(Boolean); - this.registerCustomProvider({ - id: 'ollama', - name: 'Ollama', + this.registry.registerProvider('ollama', { baseUrl: `${ollamaUrl}/v1`, apiKey: 'ollama', + api: 'openai-completions' as never, models: modelIds.map((id) => ({ id, name: id, reasoning: false, + input: ['text'] as ('text' | 'image')[], + cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 8192, maxTokens: 4096, })),