Mark Pitt
claude-skills
  1. claude-skills
  2. AI engineering
  3. local-llm-serving
  4. references/alternatives.md

A file in local-llm-serving

references/alternatives.md

Markdown 3.1 KB
alternatives.mdMarkdown, rendered

Alternatives: Ollama and LM Studio

llama-swap is the choice when you need exact control of the llama.cpp build, per-model flags, and request-driven swapping between several models on one card. The alternatives trade some of that control for less setup. Pick by what you need to pin, not by which one is newest.

Contents

  • Comparison
  • Ollama
  • LM Studio
  • When to switch, and what carries over

Comparison

Needllama-swapOllamaLM Studio
Pin the exact llama.cpp build per modelYes, by path in cmdLimited: the bundled runtimeLimited: its own runtime
Per-model flags (-ngl, --fit, -ctk, -ub)Yes, all of themPartly, through Modelfile parameters and server environmentPartly, through its load settings
Swap models on requestYes, by model fieldYes, with a loaded-model limitYes, through its server and UI
Headless service on LinuxYes, a user unitYes, a system or user serviceMainly a desktop app; its server can run, but it is not the usual headless choice
OpenAI-compatible APIYesYesYes
llama.cpp-specific endpoints (for example a decision route)Yes, when the build has themNot generallyNot generally
Model library and downloadsManual GGUF placementBuilt-in libraryBuilt-in browser

Ollama

  • A background service that loads models on request, with its own model store.
  • Context and cache are set per model in a Modelfile (num_ctx), and server-wide through environment variables such as flash attention and KV cache type. Check the names against the release you run.
  • Concurrency and the number of models loaded at once are server settings. Expect less per-model control over batch sizes than llama-swap gives.
  • Its OpenAI-compatible route is under /v1. A custom llama.cpp route is not generally exposed.
  • Use it when the model library and simple setup matter more than pinning the build.

LM Studio

  • A desktop application with a local server. Its GUI manages downloads and loading.
  • Good for interactive use and quick trials. Less suited to a headless service that must come back after a reboot without a logged-in desktop.
  • Its server exposes an OpenAI-compatible API. Check the port and the authentication setting in the release you run before wiring a client to it.
  • Use it for interactive work on a desktop. Move to llama-swap when the same model must run unattended.

When to switch, and what carries over

  • The client side is the same: an OpenAI-compatible base URL and a model id. A switch changes the address and the id, not the agent's code, if the client reads both from configuration.
  • Keep the model alias in LiteLLM (see litellm-routing.md). Then changing the serving backend is a change to the gateway entry, and every agent keeps its alias.
  • Re-measure the footprint after a switch. The same GGUF can use more or less memory under a different runtime, so the planning in vram-and-disk-planning.md must be redone for it.
  • Do not run two servers on the same card at the same time without measuring both. The second load can fail, or both can slow to a crawl.