Skip to content

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

github.com/yasuoiwakura
2 pointsMK2k1 comment
On HN

Comments

MK2kOP

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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.