links:
Declare a budget, name your models
You import it, declare a memory budget, and name the models you want to call. Vramen holds each one in its own process for as long as the budget allows, hands it to callers a lease at a time, and evicts the least recently used idle model when something else needs the room.
from vramen import CausalModel, EncoderModel, InferenceModelResourceManager
from vramen import qwen_chat_prompt
manager = InferenceModelResourceManager(quota_gb=24.0)
writer = CausalModel(
"Qwen/Qwen3-8B", qwen_chat_prompt, manager, mem_required_gb=17.0
)
embedder = EncoderModel(
"Qwen/Qwen3-Embedding-0.6B", manager, mem_required_gb=2.0
)
answer = writer.complete("You are terse.", "Name three seabirds.", max_new_tokens=64)
vectors = embedder.encode(["a passage of a story", "another passage"])
Both models load on first use and stay loaded.
Install
uv add vramen # or: pip install vramen
Requires Python 3.12 or newer, and pulls in torch, transformers, accelerate and tqdm. Image generation is an extra — uv add 'vramen[image]' — which adds diffusers and Pillow.