Skip to content

Add support to self-hosted models via ollama#1228

Open
marcellomaugeri wants to merge 1 commit into
google:mainfrom
marcellomaugeri:main
Open

Add support to self-hosted models via ollama#1228
marcellomaugeri wants to merge 1 commit into
google:mainfrom
marcellomaugeri:main

Conversation

@marcellomaugeri

Copy link
Copy Markdown

This PR adds experimental support for self-hosted models via Ollama's OpenAI-compatible API.

Use it with --model ollama/<tag>, where <tag> is the model tag served by the Ollama instance.
The default endpoint is http://localhost:11434/v1, overridable with OLLAMA_BASE_URL.

Implemented as a GPT subclass that overrides _get_client() (same pattern as AzureGPT) and get_model() to strip the ollama/ prefix before sending to the API.
GPT.get_model() is changed from a no-op placeholder to return self.name.

Tested end-to-end with gemma4:e4b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant