vram-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@vram-mcpFree up 2GB of VRAM"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
vram-mcp
Give your AI agents a shared view of GPU memory. Through MCP, they can inspect what's using VRAM, make room for Ollama models, and see which sessions are already relying on them.
Each client runs its own server; sessions under the same OS user share claims, reservations, pending-operation records, and an audit log. Capacity and process readings apply to one configured GPU. Claimed or recently busy models are protected from eviction by default.
Get started
Use Python 3.10+, a running Ollama instance, and an NVIDIA GPU with
drivers for memory readings. Windows and Linux are tested. Without
nvidia-smi or NVML, model operations and claims still work, but some readings
are unavailable.
Run vram-mcp on the machine hosting Ollama and the GPU. Changing
OLLAMA_BASE_URL redirects model requests; GPU and process inspection always
remain local. On a multi-GPU host, set VRAM_MCP_GPU_INDEX in every client's
server environment to select the same device; the default is GPU index 0.
Connect your client
With uv and Git
installed, choose your client below. uvx fetches vram-mcp from GitHub into an
isolated environment; no source checkout is needed.
claude mcp add vram --scope user -- uvx --from git+https://github.com/sushiHex/vram-mcp vram-mcpcodex mcp add vram -- uvx --from git+https://github.com/sushiHex/vram-mcp vram-mcpHermes — merge into ~/.hermes/config.yaml:
mcp_servers:
vram:
command: uvx
args: ["--from", "git+https://github.com/sushiHex/vram-mcp", "vram-mcp"]Merge this entry into your client's MCP configuration:
{
"mcpServers": {
"vram": {
"command": "uvx",
"args": ["--from", "git+https://github.com/sushiHex/vram-mcp", "vram-mcp"]
}
}
}If the client cannot find uvx, use its absolute executable path. In JSON,
Windows paths need escaped backslashes, such as C:\\tools\\uvx.exe.
Reconnect your client after registration. It launches the server over stdio;
running vram-mcp by hand waits for MCP input. Prefer a local installation?
See installing from source.
Make your first check
Ask your agent:
Check GPU memory with vram-mcp. Show what's loaded, who is using it, and how much room is left. Report any unavailable readings.
The agent should call vram_status() and list_claims(). Status includes a
readable summary, the selected GPU, loaded models, available process details,
and observations metadata. Check each observation's status; unavailable
means the corresponding value is unknown, rather than empty or zero.
list_claims() also shows capacity reserved for training or other non-Ollama
work.
Related MCP server: Ollama MCP Server
Agent workflow
These examples are MCP tool calls made inside a connected client, not shell
commands or a Python API. Use a descriptive session label for owner and by,
such as codex:review, so another agent can identify your work.
Inspect before changing memory. Call
vram_status()andlist_claims(). Model names are canonicalized consistently: a bare final name such asllama3becomesllama3:latest; comparison is case-insensitive, and Ollama's default registry/library prefix is removed.Claim a model before relying on it. Replace the example model below with one already installed in Ollama. Continue only if the claim succeeds, and save its returned
claim_id.claim(model="llama3:latest", owner="codex:review", purpose="Review local code")Make room when needed.
ensure_free(gb=8, by="codex:review")unloads unprotected models largest-first. Choose the target for your workload and checkoutcome,free_mb,declined,reserved_mb, andobservations. It does not evict when selected-GPU capacity or Ollama residency is unknown. Reaching the target does not give you ownership of that space.Load and check. Call
warm(model="llama3:latest", keep_alive="10m", by="codex:review")when needed. Inspectoutcome,reason, andobservations.succeededmeans residency was reconciled after the request;refusedmeans no Ollama request was sent;failedmeans Ollama definitively rejected it; andunknownmeans the request may still be running and includespending_until. Do not retry a same-model mutation until that pending window ends. Warm admission is also serialized across models sharing the selected GPU. A model that was already resident has zero incremental residency cost (reason="already_resident"). Loading successfully does not guarantee full GPU residency. Run inference through your usual Ollama client.Renew and release. Claims expire after one hour by default. Call
renew(claim_id="<returned claim_id>")before expiry for longer work andrelease(claim_id="<returned claim_id>")when finished, including if loading fails. Releasing a claim does not unload the model; claim expiry and Ollama'skeep_aliveare separate.
For training or diffusion, use reserve(gb=8, owner="codex:training", purpose="LoRA training") to declare capacity, then renew/release its claim_id
in the same way. A reservation records intent; it does not allocate memory.
Validation rejects invalid requests: capacities, TTLs, and trend windows
must be finite and positive; model, owner, purpose, and caller labels must be
nonblank; warm accepts a positive Ollama duration or -1 for indefinite
residency. Use unload() rather than a zero keep_alive.
Coordination is cooperative. Direct Ollama calls can bypass it. force=True
on unload, ensure_free, or warm overrides claims, busy protection, or
reservation admission; use it only after resolving competing work. It does not
bypass an unreadable coordination ledger or another pending mutation.
busy=null means unknown and does not block eviction on its own. See
coordination details.
Understand the readings
| Meaning |
| No pressure detected in the available readings. |
| Less than 1 GiB is free on the selected GPU. |
| Ollama placed part of a model on the CPU; expect slower inference. |
| Unexplained non-local memory meets the spill threshold and, when free VRAM is known, exceeds it. Driver paging is suspected. |
Missing required telemetry produces pressure.state="unknown". Read
pressure.coverage and top-level observations to see which evidence was
available. Driver-spill detection is best effort and requires non-local memory
that can be attributed to the selected GPU; adapter-aggregated Windows counters
do not establish that. CPU offload is tracked separately. Disabling auditing
stops history detection and trend sampling, but does not disable current GPU or
process observations.
Use history() to investigate a model disappearing and trend(hours=1) to
review memory changes. Trends are sampled when vram_status() reads the GPU;
there is no background sampler. See diagnostics.
Tools
The client's MCP schema provides full arguments and defaults.
Tool | Purpose |
| Inspect GPU memory, models, claims, activity, and pressure. |
| List resident models and their claim/busy details. |
| Try to reach a free-memory target by unloading unprotected models. |
| Evict a named model, respecting claims and recent activity. |
| Load a model for a chosen |
| Declare model use or capacity needed for other GPU work. |
| Extend or end your claim or reservation. |
| See active model claims and capacity reservations. |
| Review recorded actions, observed changes, and memory samples. |
| Get configuration suggestions; no settings are changed. |
Guides
Guide | Read it for |
Source installation, environment variables, and connection troubleshooting. | |
Claims, reservations, protection limits, pressure, and audit history. |
Development
git clone https://github.com/sushiHex/vram-mcp.git
cd vram-mcp
python -m venv .venvActivate with source .venv/bin/activate on Linux or
.\.venv\Scripts\Activate.ps1 in PowerShell, then run:
python -m pip install -e ".[dev]"
python -m pytest -qTests use mocked GPU, process, and HTTP calls; no GPU or Ollama daemon is needed. CI covers Python 3.10–3.14 on Windows and Linux. Current model management targets Ollama and NVIDIA; AMD/Intel telemetry and vLLM/llama.cpp management are future work.
License
MIT — see LICENSE. Companion project: hardline-mcp for agent messaging.
This server cannot be deployed
Maintenance
Related MCP Connectors
On-demand GPU nodes for agents: create nodes, run commands, and submit jobs, billed by the minute.
Provides capabilities that let LLM agents perform a range of infrastructure management tasks.
Will this LLM fit on your GPU, multi-GPU rig or Mac? Exact VRAM & KV-cache math. Read-only.
MemoryOracle - 10 agent memory tools: vector store, recall, summarization, redaction.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with locally running Ollama models through chat, generation, and model management operations. Supports listing, downloading, and deleting models while maintaining conversation history for interactive sessions.330 npmMIT
- AlicenseBqualityDmaintenanceEnables complete local Ollama management including listing models, chatting with local LLMs, starting/stopping the server, and getting intelligent model recommendations for specific tasks through natural language commands.94MIT
- AlicenseBqualityFmaintenanceExposes vLLM capabilities to AI assistants, enabling chat completions, model management, and platform-aware container control with automatic detection of Docker/Podman and GPU availability across Linux, macOS, and Windows.128Apache 2.0
- AlicenseAqualityDmaintenanceExposes NVIDIA GPU metrics (info, utilization, VRAM, temperature) via MCP tools for real-time querying from AI assistants.5MIT