# Cheat sheets

> The memory rule, the speed thresholds, default ports and the ten commands you will actually use. One screen each.

Four things you will look up again and again. Each one fits on a screen.

## Memory rule of thumb

Multiply the parameter count by the footprint for your quantization, then add room for the context.

| Quantization | Budget per billion parameters | Example: an 8B model |
| --- | --- | --- |
| 4-bit (Q4_K_M, 4bit) | about 0.6 GB | About 5 GB |
| 8-bit (Q8_0, 8bit) | about 1.1 GB | About 9 GB |
| 16-bit (F16, BF16) | about 2 GB | About 16 GB |

**Rule of thumb.** 
Leave a few GB free after the model loads, more for long contexts. On a Mac, count on macOS keeping a share of memory for itself.

For a mixture of experts model, count all the parameters for memory, not only the active ones. [Will it fit?](https://localagi.co/will-it-fit) does the sum with context included, and [Will the model fit in my memory?](https://localagi.co/memory) explains where the rest goes.

## Speed thresholds

The minimum writing speed at which each job feels usable.

| Use case | Speed | Why |
| --- | --- | --- |
| Batch or overnight | under 10 tok/s is fine | Throughput per dollar matters more than latency. |
| Reading-speed chat | 10 to 30 tok/s | Human reading is about 7 to 15 tok/s. 15 and up feels comfortable. |
| Coding assistant | 30+ tok/s | Plus fast prefill. Large prompts need a quick time to first token. |
| Agent loops | 50+ tok/s | Multi-step tool calls multiply token counts. Reasoning models emit thousands of thinking tokens. |

Human reading speed is about 7 to 15 tok/s. [How fast is fast?](https://localagi.co/how-fast-is-fast) lets you feel each speed before you buy anything.

## Default ports

Every runtime that serves an API listens on a local port. Point your apps at `http://localhost:`, and add `/v1` for the OpenAI-compatible endpoints.

| Runtime | Port |
| --- | --- |
| Ollama | 11434 |
| LM Studio | 1234 |
| llama.cpp (llama-server) | 8080 |
| vLLM | 8000 |
| SGLang | 30000 |
| BaseRT | – |
| Superfluid | 8453 |

**The catch.** 
These are defaults. Two runtimes on the same port will clash, and some apps let you change the port. If an app cannot connect, check which port the server says it started on. [How do I call a local model from code?](https://localagi.co/local-api) covers the endpoints.

## Ten commands

Most of these are Ollama, because it is the most common runtime. [How do I use Ollama?](https://localagi.co/ollama) and [What is llama.cpp?](https://localagi.co/llama-cpp) have the full reference.

```bash
# 1. Download and chat with a model
ollama run qwen3:8b

# 2. Download without starting a chat
ollama pull qwen3:8b

# 3. List downloaded models and their size
ollama list

# 4. Show loaded models and whether they are on the GPU
ollama ps

# 5. Delete a model to free disk space
ollama rm qwen3:8b

# 6. Chat and print the speed after each answer
ollama run qwen3:8b --verbose

# 7. Check the local API answers
curl http://localhost:11434/v1/models

# 8. Serve a GGUF file with llama.cpp, all layers on GPU, 16K context
llama-server -m model.gguf -ngl 99 -c 16384 --jinja

# 9. Download one quantization from Hugging Face
hf download <user>/<repo> --include "*Q4_K_M*" --local-dir ./models

# 10. Watch NVIDIA GPU memory and load
nvidia-smi
```

**Try it.** 

```bash
curl http://localhost:11434/v1/chat/completions -H "Content-Type: application/json" -d '{"model": "qwen3:8b", "messages": [{"role": "user", "content": "Say hello in five words."}]}'
```

This is the same call most apps make. If it answers, any OpenAI-compatible app can use your local model.
