miu-3's profile picture
miu-3

ollama-generator

Public

Forked from lmstudio/openai-compat-endpoint

Connect LM Studio to self-hosted Ollama APIs and chat with your models.

61 Downloads

1 star

README

Ollama Generator

Based on LM Studio’s OpenAI Adapter

View in LM Studio · View on GitHub

Use your Ollama models in LM Studio, with optional API key authentication.

Features

  • Streaming chat, thinking, and tool calling with user approval.
  • Sampling controls, context length, response length, and seed.
  • Stop strings and model keep-alive settings.
  • Native generation stats and optional context usage (Beta).
  • Request timeouts and tool-call limits.

Installation

Click Run in LM Studio on the page above to install the adaptor.

For local development, run npm ci && npm test, then npm run dev.

Options

Leave generation options unset to use server defaults. Thinking and tool support depend on the model.

OptionDescription
ThinkingServer default, Off, On, Low, Medium, or High.
Context LengthMaximum context tokens per request.
Response LengthMaximum output tokens. Use -1 for unlimited.
TemperatureSampling randomness.
Top K SamplingCandidate token limit. Use 0 to disable.
Repeat PenaltyRepetition control. Use 1 for no penalty.
Top P SamplingCumulative probability threshold.
Min P SamplingMinimum probability relative to the most likely token.
Stop StringsJSON array of stop sequences, e.g. ["<END>"].
Keep AliveSeconds to keep the model loaded. 0 unloads after a response, -1 keeps it loaded.
SeedSampling seed. Use -1 for a random seed.
Request TimeoutMaximum seconds per model request.
Maximum Tool RoundsMaximum tool-call rounds per response.
Context Usage (Beta)Prompt + output tokens from the last request, with the loaded context limit.

Limitations

  • Image attachments are currently unavailable with the adaptor alone.
  • The SDK provides no API to synchronize native context counters with Ollama.
  • Ollama's generic stop is shown as EOS; it does not distinguish stop strings.
  • The SDK cannot hide Prediction Loop warnings (loader.info.activePredictionLoopHandlerWarning).