Ollama

Ollama runs open-weight models on your own machine. Supercompat points an OpenAI client at the Ollama server's OpenAI-compatible endpoint.

Install

npm install supercompat openai
Make sure Ollama itself is installed and running:
ollama serve ollama pull llama3.2

Minimal setup

import OpenAI from 'openai' import { supercompat, ollamaClientAdapter, completionsRunAdapter, memoryStorageAdapter, } from 'supercompat/openai' const ollama = new OpenAI({ apiKey: 'ollama', // Ollama accepts any non-empty value. baseURL: 'http://localhost:11434/v1', }) const client = supercompat({ clientAdapter: ollamaClientAdapter({ ollama }), storageAdapter: memoryStorageAdapter(), runAdapter: completionsRunAdapter(), }) const response = await client.responses.create({ model: 'llama3.2', input: 'Say hello.', })

Remote Ollama

Change the baseURL to reach an Ollama host on another machine:
const ollama = new OpenAI({ apiKey: 'ollama', baseURL: 'http://gpu-box.local:11434/v1', })

Models

Any model you've pulled with ollama pull. Browse the library at ollama.com/library.
Some current examples:
llama3.2
llama3.1:70b
qwen2.5:32b
mistral-nemo
gpt-oss:20b