logo

A proxy to translate OpenCode OpenAI calls to native Ollama, allows ctx >4096

Posted by MK2k |2 hours ago |1 comments

MK2k 2 hours ago

A lightweight HTTP proxy that translates OpenAI /v1/chat/completions requests to Ollama's native /api/chat API and back.

Ollama's OpenAI-compatible endpoint (/v1/chat/completions) has serious runtime configuration limitations.

Without custom model files, parameters such as context size cannot be centrally controlled. Requests through the OpenAI compatibility layer may run with Ollama defaults instead of the desired runtime settings.

This proxy uses Ollama's native /api/chat endpoint directly, where runtime parameters are explicitly supported.

One .env file configures all models centrally.