ollama-lmstudio-proxy

skill
Guvenlik Denetimi
Basarisiz
Health Gecti
  • License — License: Apache-2.0
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 29 GitHub stars
Code Basarisiz
  • rm -rf — Recursive force deletion command in scripts/refresh-api-docs.sh
Permissions Gecti
  • Permissions — No dangerous permissions requested

Bu listing icin henuz AI raporu yok.

SUMMARY

Use LMStudio with Ollama API

README.md

Ollama to LM Studio proxy

Use LM Studio models with anything that speaks the Ollama API.

Claude Code, VSCode Copilot, Open WebUI, any other Ollama client: point it at this proxy and it reaches LM Studio.

Release
License: MIT OR Apache-2.0
Crates.io
Downloads

Features · Install · Quick start · Alternatives · FAQ · Docs

preview

✨ Features

  • Every Ollama endpoint: chat, generate, embeddings, tags, ps, show, pull, create, copy, delete, blobs. Each one is rewritten into the LM Studio call that matches it.
  • Ollama-style model names: LM Studio ids appear under the names Ollama clients expect. /api/create and /api/copy add your own aliases on top.
  • Streaming with real token counts: SSE, cancelled when the client hangs up. Non-streaming chat/generate report LM Studio's own eval_count / eval_duration / prompt_eval_*. Streaming reports them on the native chat path (--use-native-chat or --native-chat-streaming); the default path estimates them, because LM Studio's v0 stream carries no stats chunk.
  • Reasoning: think / reasoning_effort map onto LM Studio's reasoning tiers, the model's reasoning comes back in thinking. A reasoning-capable model thinks by default when think is omitted, matching Ollama.
  • Context window: options.num_ctx reloads the model at that size before inference, since LM Studio fixes context at load time. An instance already loaded at the right size is reused. --default-context-length / OLLAMA_CONTEXT_LENGTH covers requests that omit it.
  • Passthrough: /v1/* and /api/v1/* go straight to LM Studio, so Anthropic Messages (/v1/messages) and OpenAI Responses (/v1/responses) work as they are. On the way through, the proxy remaps the model name and applies two compatibility shims: response_format: json_object, base64 embeddings.
  • Web tools: /api/web_fetch returns {title, content, links} with HTML rendered to markdown. /api/web_search forwards to whichever provider --search-url names. Neither needs an ollama.com account.
  • Auth: --api-key / OLLAMA_API_KEY puts a Bearer gate on every route, GET /api/version and CORS preflight aside. Leave it unset and the proxy stays open.

📦 Install

cargo install ollama-lmstudio-proxy

Pre-built binaries live on the Releases page. To build the tip of main: cargo install --git https://github.com/uwuclxdy/ollama-lmstudio-proxy.git.

🚀 Quick start

Requires LM Studio 0.4.0+, the release that shipped the /api/v1 REST API the proxy resolves models through.

# defaults: binds 0.0.0.0:11434, talks to LM Studio on :1234
ollama-lmstudio-proxy

# common overrides
ollama-lmstudio-proxy \
  --listen 0.0.0.0:11434 \
  --lmstudio-url http://localhost:1234 \
  --load-timeout-seconds 30

[!WARNING]
Stop any running Ollama server first. It holds the same port.

At most once a day, startup asks GitHub for the newest release tag and logs a line if yours is older. No flag turns that off.

Then set your client's Ollama host to http://localhost:11434. Anthropic and OpenAI clients can use that address too: LM Studio serves /v1/messages and /v1/responses itself, the proxy passes those through.

Every flag: Configuration.

🤝 Alternatives

Pick by the protocol your client speaks:

Tool What it does Difference
ollama-lmstudio-proxy (this) Speaks the Ollama API, forwards to LM Studio One Ollama endpoint, LM Studio behind it
ollama-lmstudio-bridge, Ollm-Bridge Symlink model files between Ollama and LM Studio on disk Shares model files on disk, no request translation; you still run two servers
LiteLLM Multi-provider proxy, can use LM Studio as a backend OpenAI in and out; no Ollama API
llama-swap OpenAI-compatible router with automatic model swapping OpenAI protocol only; no Ollama API

Use this one when your client speaks Ollama. For OpenAI-native clients, LiteLLM or llama-swap fit better.

❓ FAQ

How do I use LM Studio with the Ollama API?
Run this proxy on port 11434, start LM Studio on 1234, point your Ollama client at http://localhost:11434.

Can I use Claude Code with LM Studio?
Yes. Claude Code speaks the Anthropic Messages API, which LM Studio serves at /v1/messages. Set ANTHROPIC_BASE_URL=http://localhost:11434 and the proxy forwards it.

How do I connect VSCode Copilot or Open WebUI to LM Studio?
Set the client's Ollama host to http://localhost:11434. Model names show up in Ollama style; streaming, reasoning, tool calls all run when the model supports them.

Do I need to stop Ollama first?
Yes. Ollama and the proxy both want port 11434.

📚 Documentation

The wiki is the full technical reference:

Page What's inside
Configuration Every CLI flag, env var, and experimental option
API Compatibility Per-endpoint behaviour, passthrough rules, virtual aliases
Request Shapes and Options Ollama vs OpenAI payload styles and option mappings
MCP Integrations Forwarding MCP tools through the native chat path

🛠️ Development

cargo test            # run the test suite
cargo run -- --help   # see every flag

api-docs/ is the source of truth for upstream API behavior. Issues and pull requests are welcome.

📄 License

MIT or Apache-2.0, at your option. Contributions land under both.

Yorumlar (0)

Sonuc bulunamadi