Local inference lab

    Learn by doing · Inference, not training from scratch

    References checked

    01

    Start with the hardware you have

    Choose the exact memory capacity, then your task. A larger GPU generation number alone does not tell you which model will fit. The selections are saved in this page’s URL.

    Planning memory

    10 / 12 GB

    After a 2 GB reserve. Dedicated GPU memory; host RAM is separate.

    Desktop examples. The 3060 and 3080 have different memory variants; check your exact card. A used 3090 offers capacity, but check cooling, power supply and condition.

    Editorial starting points for one request at 4K context, not measured fit or speed. We reserve 2 GB on NVIDIA; on Mac, the greater of 6 GB or 25%. Actual available memory, runtime, quantization and image size decide fit. Long context and concurrent requests require a fresh memory test. Video uses its separate reference recipe.

    First experiment: Qwen3.5 4B. Compare larger candidates after it works.

    Starting candidate

    Qwen3.5 0.8B

    Package ≈ 1.3 GB · starting budget 3 GB

    qwen3.5:0.8b

    A tiny first-run experiment. Useful for observing inference; limited reasoning and factual reliability. Try one small image only.

    Starting candidate

    Qwen3.5 9B

    Package ≈ 7.6 GB · starting budget 10 GB

    qwen3.5:9b

    A larger general-purpose comparison for chat, coding and image questions. The chosen package matters: the MLX listing can be larger than the GGUF package.

    More memory / offload needed

    Qwen3.8 27B

    Package ≈ 18 GB · starting budget 22 GB

    qwen3.8:27b

    Our current Qwen workstation starting point for chat, coding and vision. Test short context on a 24/32 GB GPU; images, long coding sessions and parallel users need more memory. Apache 2.0; validate your workload.

    More memory / offload needed

    Qwen3.6 35B-A3B

    Package ≈ 23 GB · starting budget 28 GB

    qwen3.6:35b

    A MoE comparison for a 32 GB GPU or sufficient free unified memory. About 35B total / 3B active; the full Q4 package is 23 GB. The 28 GB starting budget is editorial, not a measured minimum or speed claim.

    More memory / offload needed

    Qwen3.5 122B-A10B

    Package ≈ 81 GB · starting budget 96 GB

    qwen3.5:122b

    A larger MoE comparison for 128 GB+ unified-memory systems or a sufficiently large GPU. 122B total / 10B active; the 81 GB package is not the running footprint. Start small before attempting this download.

    Start with Ollama or LM Studio; confirm GPU use before increasing the model or context. llama.cpp exposes offload and cache settings for deeper experiments.

    Continue to setup →

    02

    Pick the model for the job

    Start with a small, supported instruct model. Increase size only after measuring what it gets wrong on your own tasks.

    Open source ≠ downloadable weights
    Open-weight means you can obtain the weights. It does not automatically include training data, a reproducible training recipe or unrestricted use. Read the exact checkpoint license, including commercial and redistribution terms. Quantizations and fine-tunes inherit obligations; a runtime’s license is separate.
    Chat, Korean and coding
    Qwen3.5 4B/9B are small starting points; compare Gemma 4 12B and Qwen3.8 27B when memory allows. For coding, test a real patch plus tests before moving to Qwen3-Coder or Coder-Next. A chat model can explain code; IDE completion, tool calls and autonomous edits require compatible templates and a harness. Korean quality is task-specific, not guaranteed by a multilingual label.
    Image understanding → text
    A vision-language model can describe a photo, read a chart or inspect a screenshot. A text-only model cannot see an attachment. Load the matching vision components/processor supported by the runtime; a bare language GGUF may be insufficient. Try one low-resolution image and check OCR against the original. More images and pixels increase processing and memory.
    Image generation → pixels
    Use a separate image model and workflow, such as FLUX.2 [klein] 4B in ComfyUI. An image-understanding LLM does not become an image generator by changing its prompt. Begin with batch 1 and a small canvas; the text encoder, denoiser and VAE all matter. Some workflows call remote encoders or APIs: check each node before calling the workflow local.
    Video generation → a sequence of frames
    Wan2.2 TI2V-5B is a documented learning baseline, not a claim to be the newest video model. Its official 24 GB CUDA recipe uses CPU offload. Start with the supplied workflow and short clips; resolution, frames, steps and concurrent jobs affect cost. A vision model summarizing an existing video is a different task. Mac support depends on the specific workflow and operators; the CUDA recipe does not validate Metal.

    03

    Install, run, verify

    First get one small model working. Then connect your tools or try a specialized image/video workflow.

    1. Inventory first: on Windows/Linux run nvidia-smi for the GPU and VRAM; on Mac use About This Mac for chip and unified memory, then Activity Monitor for memory pressure. Laptop GPU names do not imply desktop VRAM. Keep enough free disk space for the download and its cache.
    2. Choose one runtime. For a GUI, install LM Studio from its official site, download a supported small quantization, set a 4K context, load it and open Chat. On Apple silicon choose a supported MLX or Metal/GGUF backend. For a terminal/API workflow, use Ollama below. Update your NVIDIA driver and runtime before testing RTX 50-series support.
    3. Use a harmless first prompt: “Explain prefill and decoding in three sentences, in Korean.” Then try one short file or image. Confirm the expected backend is active, record peak memory, and only then increase model size or context.

    Terminal: first local chat

    Install the current Ollama release from the official download page. On Windows/macOS start the app; on Linux follow its installer and service instructions. If no service is running, start ollama serve in another terminal. Do not start a second server on the same port.

    Terminal · Windows / macOS / Linux
    ollama pull qwen3.5:4b
    ollama run qwen3.5:4b

    Inside the chat, set a small context explicitly. This is a learning session, not a full-repository agent context.

    Inside the Ollama chat
    /set parameter num_ctx 4096

    In another terminal, inspect placement with ollama ps. Use /bye to exit the chat; ollama stop unloads the named model. These names are local downloads, not :cloud tags. Run a smaller model if memory pressure rises.

    Inspect / unload
    ollama ps
    ollama stop qwen3.5:4b

    Connect an app or coding editor

    Choose the client’s local/OpenAI-compatible provider, enter the server base URL and exact loaded model ID, then send a simple chat. LM Studio requires starting its local server. Keep it on loopback for personal use; a placeholder client key is not authentication.

    Ollama
    http://127.0.0.1:11434/v1
    LM Studio
    http://127.0.0.1:1234/v1
    vLLM
    http://127.0.0.1:8000/v1

    Try code explanation before file editing. Verify tool-call support separately and use a disposable repository for an agent. Do not enable network access, shell execution or cloud fallback by accident.

    Images & video: ComfyUI

    1. Install Comfy Desktop for your OS; on Linux use the official manual installation. Select a local workflow, not a cloud API node.
    2. Open the official FLUX.2 Klein 4B or Wan2.2 TI2V-5B example below. Download the exact denoiser, text encoder and VAE listed there and select them in the matching loader nodes.
    3. Run the supplied example at batch 1. Save the workflow and seed before changing dimensions or steps. Keep custom nodes to a minimum; they are executable code. For Mac, verify every node’s Metal support; consider a CUDA cloud GPU for video.

    04

    What actually needs to fit?

    Running memory = weights + context/state cache + working buffers + other applications. Download size is only the first part.

    Weights & quantization
    A rough weight-only floor is parameters × bits ÷ 8. An 8B model at 4 bits starts at 4 GB before scales, metadata and unquantized layers. Q4_K_M is not exactly four bits for every parameter. Compare Q4/Q5/Q8 on the same tasks: smaller files save memory but can change quality. FP16/BF16 use roughly two bytes per weight. These are inference budgets; training and fine-tuning have additional memory costs.
    Context, KV cache & MoE
    The context includes instructions, history, retrieved text, tool output and the answer. Attention models retain key/value tensors so they need not recompute all past tokens. Cache grows with sequence length and concurrent requests; sliding-window and hybrid architectures differ. In MoE, active parameters describe computation per token, not the total weights you must store. A 3B-active / 80B-total model is not a 3B download.
    RAM, disk & formats
    GGUF is common in llama.cpp-based tools; MLX conversions target Apple silicon; vLLM commonly loads supported Safetensors checkpoints and quantization formats. These are not interchangeable extensions. Leave disk space for the model, download cache and conversions. Host RAM must also hold any offloaded weights and buffers. Start with existing hardware, monitor actual usage, and avoid buying memory solely from a parameter-count formula.

    05

    Why the first token and the next token differ

    A chat response has two main phases. Select a phase, then change the cache example to see why longer context and more users consume memory.

    Prefill processes the input tokens together and builds the initial cache. Long prompts can make this compute-heavy. Time to first token (TTFT) also includes queuing, network and cold loading. A long pause followed by quick text can mean expensive prefill, not slow decoding.

    Prefix caching reuses a matching earlier prompt prefix and can reduce repeated prefill; it does not inherently make each new decoded token faster. Speculative decoding uses draft tokens and verification; benefit depends on acceptance and implementation. Neither is a universal speed multiplier.

    Try a KV-cache calculation

    Teaching example only: 32 full-attention layers, 8 KV heads, 128 values per head, FP16 K/V. This is not the architecture or memory forecast of the selected Qwen/Gemma model. No prefix sharing, sliding window or cache quantization.

    0.5 GiB cache only

    2 × 32 × 8 × 128 × 4,096 × 2 × 1 ÷ 1024³

    K + V × layers × KV heads × head dimension × cached tokens × bytes × sequences. At 32K and four requests this example needs 16 GiB just for cache. Add weights and buffers. A token is a tokenizer unit, not necessarily a word; Korean and code have different tokenization.

    Measure both phases: Ollama’s response reports prompt_eval_count/prompt_eval_duration and eval_count/eval_duration (durations in nanoseconds). Divide count by seconds for each rate. Measure end-to-end TTFT separately with streaming; do not report total_duration as decoding time.

    06

    GPU only, CPU, or a hybrid?

    Try full GPU residency first when it fits. Offload is a capacity tool; measure its latency before depending on it.

    Discrete GPU: all weights on GPU
    Usually the best starting point for responsive chat. The CPU still tokenizes, schedules and runs application code: “GPU only” describes model placement. Keep room for cache and prefill buffers. A smaller model fully resident on the GPU can feel faster than a larger, partially offloaded model.
    CPU + discrete GPU offload
    llama.cpp can place some layers on GPU and the rest in system RAM. Other engines may transfer weights or cache over PCIe. CPU bandwidth, compute and transfers can bottleneck decoding. More system RAM helps capacity, not GPU bandwidth. Prefer this for experiments or tolerant batch work; compare with a smaller fully resident model. For Wan’s reference video recipe, CPU offload is an explicit part of the setup.
    Apple unified memory
    CPU and GPU share a memory pool. MLX or Metal-backed inference avoids the usual discrete GPU/RAM split, but memory bandwidth, GPU compute and runtime limits still apply. Keep macOS memory pressure low; heavy swap to SSD is not extra fast model memory. Use a smaller quantization or context before changing system memory limits. Intel Macs do not run MLX’s Apple-silicon GPU path.
    CPU only & multiple GPUs
    CPU inference is useful for tiny models, offline learning and patient batch jobs; use a supported CPU backend and measure. Two GPUs do not automatically act as one larger card. A serving engine must split weights or computation, and the slowest device/interconnect can dominate. Tensor parallelism, layer splitting and multiple independent replicas solve different problems. Verify topology before renting or buying a second GPU.

    07

    From one person to a shared server

    Optimize personal use for latency. Optimize shared service for latency under load, throughput, isolation and cost.

    One person
    LM Studio offers a desktop UI; Ollama offers a simple local service; llama.cpp exposes lower-level controls; MLX LM is an Apple-silicon programming route. Load one model, use a short context, and verify CPU/GPU placement. These tools can support more than one request, but one successful chat is not a concurrency test.
    Several people / an application
    For a Linux/CUDA server, start with vLLM and a supported checkpoint. Continuous batching shares computation across active requests; paged KV allocation reduces waste. Weights may be shared, but each session needs cache. Limit simultaneous sequences, context, output and queue length. Measure p50/p95 time to first token, per-user generation rate and total throughput under the same load. Authentication, request limits and user isolation belong in the service layer.
    Cloud GPU: rent a complete environment
    Use a VM/pod with a known CUDA image, adequate host RAM and persistent model storage. Verify GPU identity with nvidia-smi, available VRAM, region and network access. A rented GPU is self-hosted, but data leaves your device. Start with one GPU and a private endpoint; use an SSH tunnel or an authenticated TLS gateway. Secure SSH access before launching a notebook or inference server.
    Cost & shutdown
    Compute cost = hourly instance price × running hours, plus storage, traffic and other charges. Idle time, downloads and failed jobs still matter. Compare current quotes for your region and exact GPU; advertised “from” prices are not guaranteed availability. Set a budget alert and termination plan. Stopping a notebook does not necessarily stop the VM; stopped instances can still incur disk charges. Keep no secrets in shared images.

    Linux/CUDA learning server

    On a private Linux GPU machine, follow vLLM’s installation guide for the exact CUDA/driver combination. Use an isolated Python environment. This small BF16 example starts with one concurrent request and 4K context on a 24 GB-class GPU; it is not the quantized Ollama package.

    Remote server · Bash
    python3 -m venv .venv
    source .venv/bin/activate
    python -m pip install -U vllm
    vllm serve Qwen/Qwen3.5-4B --host 127.0.0.1 --port 8000 --max-model-len 4096 --max-num-seqs 1

    After a successful run, record the installed versions and checkpoint revision. Before sharing, add authentication, TLS, queue limits and a measured concurrency budget. Increase --max-num-seqs only after load testing.

    Reach it through an SSH tunnel

    On your computer, replace user@YOUR_SERVER with your SSH login. Keep this terminal open. Port 8000 remains private on the server; use an unused local port if needed. Stop the remote process with Ctrl+C when finished, then terminate the paid instance in the provider console.

    Your computer · SSH client
    ssh -N -L 8000:127.0.0.1:8000 user@YOUR_SERVER

    In a second local terminal, check the model endpoint. On Windows PowerShell use curl.exe instead of curl.

    Local terminal · macOS / Linux
    curl http://127.0.0.1:8000/v1/models

    08

    Safety on / safety off: which layer?

    There is no universal safety switch. Model behavior, content filters, privacy and tool permissions are different controls.

    The model’s learned behavior
    An instruct model has learned response preferences and refusal behavior. A base model predicts continuations and is usually a poor first chat assistant. A system prompt or a “thinking off” option does not remove training-time alignment. Community “uncensored” or modified checkpoints change behavior with uncertain quality and provenance; the label does not establish correctness, freedom from bias or safety.
    Application filters you control
    A host may add an input/output classifier, keyword policy or image safety checker independently of the model. In your own local research setup, document which checks are enabled and compare behavior on benign test prompts when changing a filter. Turning off a runtime filter does not erase learned refusals. Keep content-policy settings explicit when sharing the service; avoid a misleading single “safe” badge.
    Tool access is a security boundary
    A permissive model should still have narrow permissions. Keep coding agents in a disposable project or sandbox, review diffs, and require approval for shell commands, deletion or network actions. Retrieved documents and model output are untrusted input. Do not give a chat experiment production keys, a whole home directory or unrestricted browser/account access. Test tool-call parsing before enabling an agent loop.
    Local privacy & trusted downloads
    Download from the publisher or a documented conversion, record the revision and check the license. Prefer supported data-only weights; remote Python code and ComfyUI custom nodes can execute code. Bind a personal API to 127.0.0.1. Check telemetry, logs, cloud fallback and external tools; offline weights alone do not make the whole workflow private. For shared access, add authentication, TLS and retention controls.

    09

    Turn setup into an experiment

    Keep the prompt and hardware fixed. Change one variable, record the result, and keep the configuration you can reproduce.

    Your first comparison
    Use five Korean prompts, one document with a known answer, and a coding task with tests. Record correctness, necessary edits, first-token latency, output tokens per second and peak memory. Compare small vs large, Q4 vs Q8, 4K vs 32K context, and one vs four simultaneous requests separately. Include a warm-up run, then report repeated runs rather than one best number.
    Record enough to reproduce
    Save model ID and revision/hash, quantization, runtime version, GPU/chip and memory, driver/OS, context, output limit, batch/concurrency, prompt, seed/temperature, offload settings and cache state. Separate cold model loading from warm prefill. For images/video also record workflow version, dimensions, frames, steps and seed. Keep sensitive prompts out of public logs.
    Out of memory or very slow
    Unload other models and close memory-heavy apps. Reduce context, concurrent requests or image/video dimensions first; then try a smaller model or supported quantization. Check ollama ps, GPU logs, nvidia-smi or macOS Activity Monitor for CPU fallback and swap. After sleep or a driver update, restart the service. On RTX 50 cards, use a build that supports the GPU instead of forcing an incompatible kernel.
    Bad answers, broken tools or no image
    Confirm instruct vs base, chat template, tokenizer, context truncation and exact model/vision components. Use the publisher’s sampling guidance. Test text first, then one image, then tools; an OpenAI-compatible endpoint does not guarantee every client feature. For documents, retrieval can supply relevant passages without fine-tuning. Test evidence-grounded answers and citations before increasing agent autonomy.

    10

    Sources & where to go next

    Hardware specifications and model/runtime documentation were checked on November 10, 2026. Capacity budgets are editorial estimates; commands and model combinations have not been benchmarked across these machines. Older supported models are intentionally retained as learning baselines. This is a selected guide, not an exhaustive ranking.