# Smart Model Swap

SmartModelProvider launches and stops llama.cpp's llama-server itself, swaps in the background without cutting replies, checks per-GPU VRAM before loading.

- Type: Plugin
- Version: 0.4.0
- Updated: 22 Nov 2026
- Publisher: CarmaOS-Dev
- Category: Models

[Contact us](https://www.ulpi.io/en/support#contact)

## What it does

SmartModelProvider launches and stops llama.cpp's llama-server itself, swaps in the background without cutting replies, checks per-GPU VRAM before loading, restores the big model when idle, and ships a launch-parameter editor in the dashboard and Desktop, plus a bundled routing skill. Ollama, vLLM and LM Studio are detection-only.

Disclosure — starts and stops llama-server as a long-running background process (in a transient systemd-run --user scope when available), autostarts the primary model when the gateway starts and swaps back to it if a smaller model was left serving (GPU memory), and keeps a detached runner per swap and a watcher that restores the primary after inactivity and, by default, loads another registered model if the serving one dies; sends SIGINT/SIGKILL only to the engine process it manages or an engine of the same kind holding its port; runs nvidia-smi, ss, systemctl --user show, systemd-run and llama-server --help/--version with a minimal environment (no provider keys); reads /proc of other processes to identify the engine and GPU users, and its guard reads shell scripts a terminal command is about to run; adds one-line hints to turns, can veto terminal/execute_code calls that manage the engine by hand, and can end a turn with an explanation while the LLM is unloaded on purpose; writes its own settings to config.yaml and, only on request, installs a model-provider plugin under plugins/model-providers/smart-model-provider; HTTP only to the configured engine and ComfyUI endpoints (localhost by default). No telemetry, credentials, self-updater or approval bypass.

## Tools it adds

The tools an agent gets once this plugin is installed.

- `sms_status`
- `sms_plan`
- `sms_swap`
- `sms_restore`

## How to set it up

Run a big and a small local LLM on one GPU rig and let the agent switch between them by task: the small one for quick or voice chat and to free VRAM for GPU jobs (ComfyUI), the big one for deep work.

## Review notes

What an owner reads and accepts before the install is approved.

- Ulpi has not reviewed this version: it is listed in the public plugin catalog, and the install still fetches it at its pinned commit, checks its shape and scans it before you approve

## More in Models

- [Sovereign & Stagehands](https://www.ulpi.io/en/marketplace/plugins/sovereign-stagehands): Typed backstage subagent delegation provider (scout, librarian, code_monkey, adversary, briefer).
- [structured-aux-models](https://www.ulpi.io/en/marketplace/plugins/structured-aux-models): Routes selected Ulpi auxiliary tasks (approval, MCP sampling, compression) through bounded Jev decision calls on OpenRouter instead of free-form chat prompts.
- [surp-x402-llm](https://www.ulpi.io/en/marketplace/plugins/surp-x402-llm): Marketplace-aware LLM routing for Surp — live prices for all models, provider TPS and trusted flags, mid-chat seller switching, secret masking.

[All listings →](https://www.ulpi.io/en/marketplace) · [Publisher's guide →](https://www.ulpi.io/en/docs) · [Report a problem →](https://www.ulpi.io/en/security#report)
