Vram
БесплатноНе проверенEnables AI agents to inspect and free NVIDIA GPU VRAM by managing Ollama models, helping make room for loading new models.
Описание
Enables AI agents to inspect and free NVIDIA GPU VRAM by managing Ollama models, helping make room for loading new models.
README
An MCP server that lets AI agents inspect and free NVIDIA GPU VRAM by managing Ollama models. Handy when you juggle several local models across projects on a single GPU and an agent needs to make room before loading the next one.
- NVIDIA + Ollama only for v1.
- Degrades gracefully when
nvidia-smiis absent: VRAM readings becomeunknown, but model list / unload / warm still work.
Tools
| Tool | Behavior |
|---|---|
vram_status() |
Per-GPU VRAM (total/used/free) + loaded Ollama models (with claims, busy signal, CPU-offload) + every other VRAM-holding process + best free MB. |
list_loaded() |
The models currently resident in VRAM (name, VRAM MB, expiry, claims, busy). |
unload(model, force=False) |
Evict one model from VRAM now (keep_alive=0). Refuses if claimed/busy unless force=True. |
ensure_free(gb, force=False) |
Unload models largest-first until at least gb GB is free, skipping claimed/busy models unless force=True. |
warm(model, keep_alive="5m") |
Load/pin a model into VRAM for a duration. |
advise() |
Heuristic suggestions (e.g. OLLAMA_MAX_LOADED_MODELS=1, finite OLLAMA_KEEP_ALIVE). |
claim(model, owner, purpose, ttl_seconds=3600) |
Declare you're using a model, so others see who/why before evicting it. |
renew(claim_id, ttl_seconds=None) |
Extend a claim before it expires. |
release(claim_id) |
Release a claim early. |
list_claims(model=None) |
See active claims (all models, or one). |
Requirements
- Ollama running locally (or reachable via
OLLAMA_BASE_URL). - NVIDIA GPU + drivers for VRAM numbers.
nvidia-smiis optional — without it, VRAM is reported asunknownand model operations still function. - Python 3.10+.
Install
Run directly with uv (no install needed):
uvx vram-mcp
Or install from source for development:
git clone https://github.com/sushiHex/vram-mcp
cd vram-mcp
pip install -e .
Run
vram-mcp
The server speaks MCP over stdio, so it is normally launched by an MCP client rather than by hand.
MCP client config
Add this to your MCP client's mcpServers config (e.g. Claude Code / Claude
Desktop):
{
"mcpServers": {
"vram": {
"command": "uvx",
"args": ["vram-mcp"]
}
}
}
Configuration
OLLAMA_BASE_URL— Ollama endpoint. Defaults tohttp://127.0.0.1:11434.
Multi-session coordination
Since every session runs its own vram-mcp process, coordination happens via:
- Claims — a shared, file-based ledger (
~/.cache/vram-mcp/claims.json) recording who's using a model and why. Callclaim()when you start relying on a model;renew()periodically if still in use. An un-renewed claim simply expires — no cleanup needed if your session ends unexpectedly. - Busy detection — best-effort, via NVML's per-process GPU utilization (not point-in-time; reads a short recent window so brief gaps between tokens don't misread as idle). Requires no changes to how you call Ollama — it's entirely on vram-mcp's side.
- Protection —
unload()/ensure_free()refuse to evict a model that's claimed OR busy, by default. Passforce=Truewhen you've already decided it's worth it.
Requires the nvidia-ml-py dependency (installed automatically). Falls back gracefully — claims/busy report as empty/null — on non-NVIDIA GPUs or if NVML is unavailable.
Development
pip install -e .
python -m pytest -q
The logic modules (gpu.py, ollama.py, core.py) are free of any mcp
import and are fully unit-tested with mocks — no real GPU, Ollama daemon, or
mcp package required to run the test suite.
Roadmap
- Other backends: AMD (ROCm/
rocm-smi), Intel (xpu-smi). - Other runtimes: vLLM, llama.cpp.
License
MIT © 2026 sushiHex
Установить Vram в Claude Desktop, Claude Code, Cursor
unyly install vram-mcpСтавит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.
Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh
Или настроить вручную
Выполни в терминале:
claude mcp add vram-mcp -- uvx --from git+https://github.com/sushiHex/vram-mcp vram-mcpFAQ
Vram MCP бесплатный?
Да, Vram MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Vram?
Нет, Vram работает без API-ключей и переменных окружения.
Vram — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Vram в Claude Desktop, Claude Code или Cursor?
Открой Vram на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzCompare Vram with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
