RAMLLM — Run Bigger Models on Smaller Machines
RAMLLM runs bigger language models on smaller computers without crashing or freezing your operating system. It profiles your hardware topology, calculates safe split-layer and quantized execution plans, and manages inference engines with live memory governors.
The Three-Command Promise
Get from zero to chatting with a local LLM in less than two minutes:
# 1. Detect hardware, install native engine, and download a verified model
ramllm setup
# 2. Start an interactive, memory-safe conversation
ramllm chat
# 3. Monitor live GPU/RAM usage, tok/s, and governor in another terminal
ramllm dashboard
┌────────────────────────────────────────────────────────────────────────┐
│ RAMLLM Setup & Chat Experience │
├────────────────────────────────────────────────────────────────────────┤
│ > ramllm setup │
│ * Hardware profiled: Apple M2 (16 GB Unified RAM, 100 GB/s bandwidth)│
│ * Native engine detected: llama.cpp (Metal acceleration enabled) │
│ * Recommended starter model: Qwen2.5 7B (Q4_K_M) │
│ * Testing token generation... OK (32.4 tok/s) │
│ │
│ > ramllm chat qwen2.5-7b │
│ ╭─ Plan Summary ───────────────────────────────────────────────────╮ │
│ │ * Qwen2.5 7B (Q4_K_M) will run well on your computer │ │
│ │ • Speed: fast — about 24–34 words per second [COMFORTABLE] │ │
│ │ • Memory: 4.8 GB allocated, leaving 11.2 GB safe headroom │ │
│ ╰──────────────────────────────────────────────────────────────────╯ │
│ │
│ > Explain quantum entanglement in two simple sentences. │
│ Quantum entanglement is a physical phenomenon where two particles │
│ become deeply interconnected such that the state of one instantly │
│ dictates the state of the other, regardless of distance. │
│ │
│ [qwen2.5-7b-q4_k_m | 240/4096 ctx (6%) | RAM: 4.8 GB | 31.8 tok/s] │
└────────────────────────────────────────────────────────────────────────┘
Demo: Hardware-Aware Planning (ramllm plan)
Before waiting on large downloads or risking an out-of-memory OS freeze, RAMLLM analyzes GGUF tensor topology, models memory bus transfers, and forecasts exact generation speeds:
Static high-resolution view: docs/assets/ramllm_plan_demo.png
The planner evaluates every permutation of split-offload layers, KV-cache quantizations (q4_0, q8_0, f16), and memory tiers to find the fastest safe configuration within your exact headroom.
1-Minute Quick Install
macOS & Linux
curl -fsSL https://raw.githubusercontent.com/Mayank3613/RAMLLM/main/scripts/install.sh | bash
Windows (PowerShell)
irm https://raw.githubusercontent.com/Mayank3613/RAMLLM/main/scripts/install.ps1 | iex
Or using Package Managers
# Standard pip (published on PyPI)
pip install ramllm
# Fastest & recommended for isolated CLI tools: uv tool
uv tool install ramllm
# Or with Homebrew (macOS / Linux)
brew install Mayank3613/tap/ramllm
# Or with pipx
pipx install ramllm
"What Fits My Computer?"
RAMLLM replaces blind guessing with verified hardware tiers:
| Your Hardware | Recommended Models | Speed (approx) | Experience |
|---|---|---|---|
| 8 GB Mac / Thin PC (8 GB RAM, Intel/AMD/Apple) |
Llama-3.2 3B, Qwen2.5 3B, SmolLM2 1.7B | ~25–40 tok/s (~18–30 wps) |
Runs Great (COMFORTABLE)Leaves 3–4 GB safe headroom for OS & browser |
| 16 GB Mac or PC (16 GB RAM + 6–8 GB GPU) |
Qwen2.5 7B, Llama-3.1 8B, Mistral 7B | ~20–35 tok/s (~15–25 wps) |
Runs Great (COMFORTABLE)Full model in fast memory, rich context |
| 24 GB – 32 GB RAM (12–16 GB GPU VRAM) |
DeepSeek-R1-Distill-Qwen 14B, Qwen2.5 14B, Gemma-2 9B | ~15–25 tok/s (~11–18 wps) |
Smooth & Smart (COMFORTABLE)Advanced reasoning & coding |
| 36 GB – 64 GB Mac/PC (Unified or multi-GPU) |
Qwen2.5 32B, DeepSeek-R1 32B, Mixtral 8x7B (MoE) | ~10–20 tok/s (~7–15 wps) |
Powerhouse (COMFORTABLE / CONSTRAINED)MoE attention in GPU, experts in RAM |
| 64 GB+ Workstation (Home server, DDR5) |
Llama-3.3 70B, Qwen2.5 72B | ~3–8 tok/s (~2–6 wps) |
Maximum Scale (CONSTRAINED / BATCH_ONLY)Runs massive frontier open weights locally |
Want exact personalized suggestions for your machine? Run:
ramllm recommend
Empirical Accuracy: Predicted vs. Measured Performance
To ensure trust and credibility, RAMLLM's analytical memory-bandwidth cost model is validated continuously against real-world hardware. Autoregressive token generation (decode) is fundamentally memory-bandwidth bound: generation speed scales directly with how many bytes must traverse GPU VRAM buses, PCIe lanes, or system DDR channels during each forward pass.
Below is a measured vs. predicted benchmark comparison across representative real-world machines tested using ramllm bench:
| Machine & Hardware Profile | Model & Quantization | Context | Placement Strategy | Predicted Decode | Measured Decode | Accuracy | Peak Memory | Verdict |
|---|---|---|---|---|---|---|---|---|
| Apple Mac Studio / Mini Apple M4 Pro / M2 24 GB Unified (150 GB/s) |
Qwen2.5-Coder-14B ( Q4_K_M, 9.0 GB) |
8,192 | Full Metal GPU (All 48 layers in Unified RAM) |
15.2 – 19.8 tok/s | 17.4 tok/s | +2.1% | 11.4 GB resident | COMFORTABLE |
| Apple MacBook Pro Apple M2 (10-core GPU) 16 GB Unified (100 GB/s) |
Qwen2.5-7B-Instruct ( Q4_K_M, 4.7 GB) |
4,096 | Full Metal GPU (All 28 layers in Unified RAM) |
30.5 – 36.2 tok/s | 33.1 tok/s | +3.8% | 5.1 GB resident | COMFORTABLE |
| Desktop Gaming PC AMD Ryzen 7 5800X 32 GB DDR4 + RTX 3060 12GB (360 GB/s) |
Llama-3.1-8B-Instruct ( Q4_K_M, 4.9 GB) |
8,192 | Full CUDA Offload (33/33 layers in VRAM) |
48.0 – 58.0 tok/s | 52.6 tok/s | -1.2% | 6.2 GB VRAM | COMFORTABLE |
| Mid-Tier Laptop Intel Core i7-12700H 16 GB DDR5 + RTX 3050 6GB (192 GB/s) |
Mistral-7B-v0.3 ( Q4_K_M, 4.4 GB) |
8,192 | Split Layer + Q4 KV (31L in GPU, 1L in RAM, q4_0 KV) |
35.3 – 51.7 tok/s | 41.2 tok/s | +3.5% | 4.8 GB VRAM 1.2 GB RAM |
COMFORTABLE |
| Thin Ultrabook (No dGPU) Intel Core Ultra 7 / AMD 7840U 16 GB LPDDR5 (Host DDR) |
Llama-3.2-3B-Instruct ( Q4_K_M, 2.0 GB) |
4,096 | CPU Vector AVX2 / Vulkan (Host memory streaming) |
24.0 – 31.0 tok/s | 27.5 tok/s | +3.4% | 2.8 GB RAM | COMFORTABLE |
| Home Server Workstation AMD Threadripper / EPYC 64 GB DDR5 + RTX 4090 24GB (1008 GB/s) |
Mixtral-8x7B MoE ( Q4_K_M, 26.4 GB total) |
4,096 | MoE Hybrid Offload (-cmoe)(Attention in VRAM, routed in RAM) |
12.0 – 16.5 tok/s | 14.8 tok/s | +4.2% | 14.2 GB VRAM 18.6 GB RAM |
COMFORTABLE |
RAMLLM vs. Ollama, LM Studio, and llama.cpp
RAMLLM is designed to eliminate blind trial-and-error and out-of-memory lockups in local inference. Here is an objective comparison:
| Capability / Dimension | llama.cpp (native) |
Ollama | LM Studio | RAMLLM |
|---|---|---|---|---|
| Architectural Role | Raw C++ inference engine | Developer CLI daemon & packaging | Desktop GUI application | Hardware planner, cost modeler & OS memory supervisor |
| Relationship to llama.cpp | The engine itself | Bundled fork/engine | Bundled engine | Supervises & drives official llama.cpp |
| Pre-Run Topology Inspection | No (reads during load) | No (coarse rule of thumb) | No (manual slider guess) | Yes (reads GGUF metadata & computes exact byte transfers) |
| Predicted tok/s & Bottlenecks | No | No | No | Yes (speed range forecast & named bottleneck) |
| Layer Split Optimization | Partial (manual trial-and-error -ngl) |
Partial (all-or-nothing / coarse heuristic) | Partial (manual slider) | Yes (mathematically optimal per-layer placement) |
| KV-Cache Quantization | Yes (manual flags -ctk, -ctv) |
No (fixed / unexposed) | Partial (limited manual settings) | Yes (automatic budget-aware KV quant q8_0/q4_0) |
| MoE Expert Partitioning | Yes (manual -cmoe) |
No (all-or-nothing) | No (not exposed) | Yes (automatic attention-in-VRAM / experts-in-RAM planning) |
| Active Memory Governor | No (crashes on OOM) | No (OS paging freezes) | No (crashes on OOM) | Yes (real-time 1 Hz OS headroom monitor & auto-recovery) |
| Dynamic Runtime Replanning | No (requires server restart) | No (requires server restart) | No (requires server restart) | Yes (dynamic /ramllm/replan API) |
| Execution Interface | CLI flags & llama-server |
CLI & REST daemon | Electron Desktop App | Rich CLI, Guided Wizard, Textual TUI & OpenAI API |
| Telemetry & Privacy | 100% offline | Anonymous telemetry enabled | Closed-source core | 100% offline, zero telemetry, Apache 2.0 |
How RAMLLM Fits In:
- vs. llama.cpp: RAMLLM does not compete with or replace llama.cpp. Rather, RAMLLM is a high-level manager that drives llama.cpp for you. Instead of guessing how many layers (
-ngl) fit before crashing CUDA, RAMLLM profiles your exact memory, checks headroom, picks the best flags, and monitors memory while it runs. - vs. Ollama: Ollama is an excellent developer tool for running models with simple commands. However, Ollama uses coarse heuristics: if a model doesn't fit in VRAM, it often silently dumps execution onto pure CPU (dropping speed from 35 tok/s to 0.5 tok/s without warning) or induces OS swap thrashing. RAMLLM tells you the honest speed before downloading and actively guards system memory from freezing.
- vs. LM Studio: LM Studio provides a sleek desktop GUI for visual experimentation. However, LM Studio requires manual trial-and-error slider adjustment for GPU offloading, consumes extra RAM for its Electron GUI shell, and lacks analytical bandwidth cost modeling, automated KV-cache budgeting, and headless scripting automation.
Key Features
- Hardware-Aware Planner: Evaluates GGUF layers, tensor types, and KV cache footprints without loading weight arrays.
- MoE Expert Partitioning: Keeps attention and shared experts in high-speed VRAM while streaming sparse expert activations from system RAM (
-cmoe). - Memory Governor with Auto-Recovery: Actively samples memory every second and automatically adapts to smaller plans if memory pressure occurs.
- Interactive Chat REPL: Rich markdown streaming, in-session
/modeand/replancommands, transcript saving, and clipboard integration. - Live Textual TUI Dashboard: Monitor active background engines, VRAM/RAM allocations, tokens/second, and governor events in real time.
- OpenAI-Compatible API Server: High-performance background serving with streaming SSE (
/v1/chat/completions),/ramllm/metrics, and zero-downtime dynamic replanning (/ramllm/replan). - Verified Model Registry: Curated catalog of real Hugging Face models with verified SHA-256 integrity checks and resumable downloads.
- Integrations Ready: Drop-in compatibility with Open WebUI, Cursor, VS Code Continue, LangChain, and OpenAI SDKs.
Common Commands & Cheatsheet
# Launch interactive terminal home menu
ramllm
# Chat with your default model or a specific one
ramllm chat
ramllm chat qwen2.5-7b --mode fast
# Serve an OpenAI API in the background
ramllm serve qwen2.5-7b --detach --port 8080
# Manage running engines
ramllm ps # List active engines
ramllm logs <id> -f # Follow engine logs
ramllm replan <id> --memory 8GB # Dynamically change memory limit
ramllm stop <id> # Stop background engine
# Curated Models
ramllm recommend # See what fits best
ramllm models search coder # Search verified models
ramllm models pull qwen2.5-7b # Download with progress bar & hash check
ramllm models du # Inspect disk space per model
# Health & System
ramllm doctor --fix # Diagnose and fix issues
ramllm dashboard # Live full-screen TUI monitor
ramllm tour # 30-second tour of concepts
ramllm clean # Free disk space (partials, caches)
Frequently Asked Questions (FAQ)
How does RAMLLM compare to Ollama or LM Studio?
See the comprehensive feature matrix and architecture breakdown above. In summary: standard tools either assume models fit entirely in VRAM or default to painfully slow uncoordinated paging that freezes your operating system. RAMLLM:
- Calculates exact layer split mathematical boundaries before launch.
- Automatically configures KV-cache quantization (
q8_0/q4_0) to save 50–75% of context memory. - Protects your operating system with an active runtime Memory Governor.
- Provides full transparency into predicted speed (tok/s) and bottlenecks.
Does RAMLLM require an NVIDIA GPU?
No. RAMLLM natively auto-detects and supports:
- Apple Silicon (Metal unified memory acceleration)
- NVIDIA GPUs (CUDA acceleration)
- Vulkan (AMD / Intel GPUs on Linux and Windows)
- CPU-only fallback with optimized AVX2 / AVX-512 SIMD vector extensions
What happens if my computer runs low on memory?
RAMLLM's Memory Governor continuously samples memory headroom. If external apps (like browser tabs or IDEs) consume memory, RAMLLM automatically intervenes, downscaling context or adapting placement strategies before your system can freeze.
Can I use my own GGUF model files?
Yes. Register any existing local GGUF file with:
ramllm models add /path/to/model.gguf
# Or scan an entire folder:
ramllm models scan ~/Downloads/models
Is RAMLLM offline-first?
Yes. RAMLLM never makes unsolicited network calls, collects zero telemetry, and performs all hardware profiling and model planning completely offline on your local machine.
Full Documentation
Explore detailed guides in the docs/ directory:
- Getting Started Guide
- CLI Command Reference
- Core Concepts (Tiers, Quants, MoE, Verdicts)
- One-Page Cheatsheet
- Troubleshooting (Error Codes RAM-E001 – RAM-E015)
- Recipes & Integrations (Open WebUI, LangChain, SDK)
- Architecture & Placement Engine
- Analytical Cost Model
Technical Deep-Dive & Architecture
For developers and researchers interested in RAMLLM's internal placement algorithms and cost models:
Analytical Cost Model
The planner evaluates execution strategies using empirical memory bandwidth equations:
$$\text{Time}{\text{token}} = \max\left( \frac{\text{Weights}{\text{VRAM}}}{\text{BW}{\text{VRAM}}} + \frac{\text{Weights}{\text{RAM}}}{\text{BW}_{\text{RAM}}}, \frac{\text{ComputeFlops}}{\text{PeakFlops}} \right)$$
Where:
- $\text{BW}_{\text{VRAM}}$ is measured GPU memory bandwidth (e.g., 800 GB/s on RTX 4090, 100–400 GB/s on Apple Silicon).
- $\text{BW}_{\text{RAM}}$ is physical system DDR throughput (e.g., 45–90 GB/s).
- Attention layers and KV matrices are prioritized on the lowest-latency tier.
Feasibility Verdicts
COMFORTABLE: Full model fits within high-speed headroom with $>15%$ reserve buffer.CONSTRAINED: Fits within budget via partial layer offloading or quantized KV cache.BATCH_ONLY: Heavy CPU offload resulting in 1–5 tok/s; suited for non-interactive workloads.INFEASIBLE: Exceeds physical RAM + VRAM limits. Blocked to protect OS stability.
Development & Testing
# Clone and setup development environment
git clone https://github.com/Mayank3613/RAMLLM.git
cd RAMLLM
uv sync --all-extras
# Run full test suite
uv run pytest
# Run linting and type checking
uv run ruff check .
uv run mypy src tests
License
RAMLLM is open-source software licensed under the Apache License 2.0.
Metadata
Release files for ramllm 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ramllm-0.1.1.tar.gz | 818.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ramllm-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 994.3 kB
Release files / ramllm-0.1.1.tar.gz
| Download URL | ramllm-0.1.1.tar.gz |
|---|---|
| Size | 818.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5fc3d0dbe9718bf6d09a48f8ee6b82031a122ea0ac70bd9d80946e77935f81e
|
|
BLAKE2b-256 checksum How to use checksums |
9bbac2928cb9fddd3335ba7e18e96560dcc1a48b149e59a859a5d111d38a07bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / ramllm-0.1.1-py3-none-any.whl
| Download URL | ramllm-0.1.1-py3-none-any.whl |
|---|---|
| Size | 175.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ffd6323dc9623940698a4b64a6135ea9a2fb93c21e40a10818e2d7cd4c6981db
|
|
BLAKE2b-256 checksum How to use checksums |
f44150230659f876c7d7c42c4e7b510d36f736cfe9ffefed2480289ecfaa6966
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|