Running a 320B Multimodal Model Locally on Four 32GB GPUs
This guide covers deploying a 320B-parameter multimodal model on four 32GB GPUs for short-context, single-request image-text inference. It explains when local deployment makes sense, how 2-bit quantized weights and the separate vision file fit together, how to confirm framework branch support, how to launch llama-server, and how to estimate VRAM use, including KV cache.
1. Scope and Limits
Local deployment gives more control than a hosted API when data cannot leave the internal network and the model is called frequently over a long period. Most public tutorials use one mainstream accelerator as their example. If you have a single 32GB workstation-class accelerator, the deployment steps are essentially the same, but you must confirm framework support and driver compatibility yourself.
This guide tests short contexts (up to 8K tokens) and single-request image-text inference. Long video understanding and high-concurrency serving are outside the tested scope. Section 4 explains why, based on the VRAM calculation.
2. Model and Quantization
Native multimodal models are trained with text, images, and video modeled together from the start. For deployment, the vision component is released separately as an mmproj file, so you need to prepare two files.
Even stored in FP16, the 320B parameters require about 640GB, which does not fit on one machine. Quantization is the only practical route. This guide uses 2-bit dynamic quantization. Sensitive tensors, such as the attention output projection and the embedding layer, keep a higher bit width. The feed-forward networks, which make up the largest share of parameters, use a very low bit width. The release page lists the main weights at about 108.7GB and the vision file at about 1.13GB (FP16), for a total of about 110GB. Treat these figures as the release page’s numbers, and check the actual file sizes after downloading.
Keep three points in mind when choosing a quantized file:
- Prefer a verified quantized file published alongside a matching inference framework branch. Converting the model yourself often causes operator incompatibilities.
- 2-bit compression is aggressive, and quality drops noticeably on long texts and complex reasoning. If possible, compare the 3-bit option before deciding.
- After downloading, verify the SHA256 checksum of each file, for example with
sha256sum <filename>, and compare it with the release page. Corrupted shards of large files are one of the most common causes of loading failures.
3. Inference Framework: Confirm the Branch Before Setting Up the Environment
3.1 Confirm Branch Support
In the GGUF ecosystem, represented by llama.cpp, new architectures usually land in an experimental branch first and merge into the main branch after validation. Before deploying, confirm which branch declares support for the architecture. You can search the commit history for the architecture keyword, or check the minimum version and branch listed on the quantized model’s release page.
Record the following details for reproducibility:
framework_branch = <branch-name>commit = <full-commit-hash>min_version = <minimum-version>model_sha256 = <main-weights-hash>mmproj_sha256 = <vision-file-hash>
After confirming the branch and building it, you can start the service with the command below. Replace the paths and filenames with your actual values:
./llama-server \-m "/models/<main-weights-file>.gguf" \--mmproj "/models/<vision-file>.gguf" \-ngl 99 \-c 8192 \--split-mode layer \--tensor-split 1,1,1,1 \--host 127.0.0.1 --port 8080
Parameter notes: -ngl 99 offloads all layers to the GPU. -c sets the context length, which directly affects KV cache usage. --split-mode layer splits the model by layer. --tensor-split allocates the layers across four cards in the given ratio. If the branch does not support tensor parallelism, layer splitting is the only option.
3.2 The Two Weight Files Must Match
The main weights handle language understanding, reasoning, and text generation. The vision encoder converts images into features, and the projection layer maps those features into the language model’s embedding space. The weights for both components are released together in the mmproj file.
Both files are required, and they must come from the same release. Without the mmproj file, the model still holds conversations normally but cannot interpret images. The projection layer has few parameters and is sensitive to precision, so it is usually kept in FP16. Compressing it is not worth the loss in quality.
3.3 Common Errors
- Loading failure or abnormal file size: The shards are corrupted or the download is incomplete. Recheck the SHA256 checksum.
- Unknown architecture or missing operator: The branch does not match the model. Switch to the branch and commit specified on the release page.
- No response to images, or answers unrelated to the image: The mmproj file was not loaded, or the vision file version does not match the main weights.
- Out of memory (OOM) at startup: Lower
-c, or check whether other processes are using VRAM.
4. Hardware and VRAM Budget
4.1 Measure Usable VRAM
Four 32GB cards total 128GB on paper. The driver, runtime, and per-card system reservations take part of that capacity. Measure the usable amount on the deployment machine:
nvidia-smi --query-gpu=name,memory.total,memory.free --format=csv# On AMD platforms: rocm-smi --showmeminfo vram
This guide assumes about 2GB reserved per card, which leaves roughly 120GB usable across four cards. This is an assumed value. Replace it with your measured result.
4.2 VRAM Budget Table
| Item | Estimate | Notes |
|---|---|---|
| Main weights | 108.7GB | From the release page |
| Vision file | 1.13GB | From the release page, FP16 |
| Usable VRAM | About 120GB | 4 × 32GB minus about 2GB reserved per card (assumed) |
| Remaining space | About 10GB | For KV cache, compute buffers, and framework overhead |
Whether the remaining space is enough depends mainly on the context length.
4.3 KV Cache Estimate
The formulas are:
bytes per token = 2 × layers × KV heads × head dimension × bytes per elementtotal KV cache = bytes per token × context length × concurrency
This example assumes 48 layers, 8 KV heads, a head dimension of 128, and an FP16 KV cache (2 bytes per element). Each token then takes about 192KB:
- 4K context: about 0.75GB
- 8K context: about 1.5GB
- 32K context: about 6GB
The architecture values in this example are for illustration only. Replace them with the actual values from the model’s config file. Compute buffers typically need several GB, so use the actual usage shown in the framework log. If compute buffers take about 4GB, only about 6GB of the roughly 10GB remains, which leaves no headroom for a 32K context.
4.4 Layer Splitting and Conclusions
In a four-card setup, layer splitting is the default, so different layers sit on different cards. Communication between cards happens only at layer boundaries. However, each request must pass through the cards in sequence, which limits throughput.
Conclusions:
- Short context (up to 8K), single-request image-text inference: Feasible when the measured usable VRAM is sufficient.
- Long video, long documents, and high concurrency: Not recommended.
