# Code Llama 7B Instruct on NVIDIA A100 (40 GB)

**Fits comfortably.** 25.8 GB headroom left for a longer context or other apps.

- Runtime: Ollama, Q4_K_M, 16K context
- Memory: 12.7 GB of 38.5 GB usable (33%)
  - Weights: 3.8 GB (published file size, codellama:7b-code-q4_K_M)
  - KV cache: 8.0 GB (exact)
  - Overhead: 0.9 GB
- Speed: 136–227 tok/s for one request (estimated)
- Largest context that fits: 16K

## Run it

```sh
ollama run codellama:7b-code-q4_K_M
```

Setup guide: https://llmsizing.com/guides/ollama

## Cost per 1M tokens at 500K tokens/day

| Path | $/1M tokens | Detail |
| --- | --- | --- |
| Local | — | $0.03 power only |
| Cloud GPU | $0.18 | 1x RTX 3090 (24 GB) on Vast.ai, $0.18/hr (provider API, 2026-11-30) |
| API | — | not on OpenRouter |

Assumes 75% input and 25% output tokens, one request at a time, $0.18/kWh, hardware written off over 36 months.

## Links

- [Check prices for NVIDIA A100 (40 GB) on Amazon](https://www.amazon.com/s?k=NVIDIA%20A100%2040GB)
- [Rent 1x RTX 3090 (24 GB) on Vast.ai](https://cloud.vast.ai/create/)
- [Open in the calculator](https://llmsizing.com/?m=codellama-7b&hw=nvidia-a100-40gb&q=q4_k_m&ctx=16384)
- [Full page](https://llmsizing.com/models/codellama-7b/on/nvidia-a100-40gb)

Source: [llmsizing.com](https://llmsizing.com/models/codellama-7b/on/nvidia-a100-40gb), data synced 2026-11-30.
