~/runthismodel
daemon okbuild 5a3c91d00:00:00Z

Can RTX 3060 12GB run Phi-4?

A

Yes — runs locally

~19 tok/sec · Good — slight pause, then text streams smoothly.

Your VRAM
12 GB
Model size
14B
Best quant
Q4_K_M
VRAM needed
8.9 GB

The verdict

The RTX 3060 12GB (12 GB VRAM) handles Phi-4 comfortably using the Q4_K_M quantization, which fits in 8.9 GB. Expected throughput is around 19 tokens/second, which feels Good — slight pause, then text streams smoothly. in interactive use. Microsoft's 14B parameter model. Punches well above its weight on reasoning.

Setup tutorial: Phi-4 on RTX 3060 12GB

AI-generated, GPU-specific. Verified commands for your exact hardware.

TL;DR

Phi-4 runs at Grade A performance on an NVIDIA GeForce RTX 3060 12GB with the Q4_K_M quantization, achieving ~48 tok/sec.

Prerequisites

Before starting, ensure you have at least 20GB of free disk space, a 64-bit version of Windows or Linux, NVIDIA driver version 470 or higher, and CUDA 11.2 or later installed.

Expected performance

With the Q4_K_M quantization, you can expect Phi-4 to run at approximately 48 tokens per second, using around 8.9GB of VRAM. This leaves about 3.1GB of VRAM for context, allowing for a practical context window of up to 8,192 tokens.

1. Install runtimeOllama

pip install ollama
ollama config set device cuda

2. Download the model

Download the Q4_K_M quantized Phi-4 model, which is 8.4GB in size.

ollama pull bartowski/phi-4-GGUF:phi-4-Q4_K_M.gguf

3. Run it

ollama run phi-4-Q4_K_M.gguf
ollama chat --model phi-4-Q4_K_M.gguf

4. Optimize for RTX 3060 12GB

For optimal performance on the NVIDIA GeForce RTX 3060 12GB, use the --n-gpu-layers flag to load as many layers as possible onto the GPU. With 12GB of VRAM, you can set --n-gpu-layers to 40 to maximize utilization without running out of memory. Additionally, enable flash attention using --flash-attn to improve efficiency. Tensor parallelism is not necessary for this model and GPU combination.

Troubleshooting

Out of memory errors during inference

Reduce the number of GPU layers using --n-gpu-layers or decrease the batch size.

Slow inference speed

Ensure that flash attention is enabled with --flash-attn and that the CUDA backend is correctly configured.

Model not found

Verify that the model was successfully downloaded and is located in the Ollama models directory.

Alternative runtimes

Alternative runtimes include LM Studio and llama.cpp. LM Studio offers a more user-friendly interface and is suitable for those who prefer a graphical environment. llama.cpp is a lightweight option for running models directly from the command line and is ideal for users who need fine-grained control over performance settings. Jan is another runtime that supports a wide range of models but may require additional configuration for optimal performance on this GPU.

Other models that run great on RTX 3060 12GB

FAQ (20)

What GPU do I need to run Phi-4?

To run Phi-4, you need a GPU with at least 8.9 GB of VRAM, but 15.0 GB is recommended for optimal performance.

Is Phi-4 good for coding?

Yes, Phi-4 is well-suited for coding tasks due to its strong reasoning capabilities and large context length of 16,384 tokens.

Phi-4 vs Llama 3.1 8B?

Phi-4 has 14 billion parameters compared to Llama 3.1's 8 billion, making it more powerful for complex tasks but requiring more VRAM.

Can I run Phi-4 on a Mac?

Yes, you can run Phi-4 on a Mac with a compatible GPU, such as an AMD or NVIDIA card with sufficient VRAM.

How much VRAM does Phi-4 need?

Phi-4 requires between 8.9 GB and 15.0 GB of VRAM, depending on the quantization level used.

Is Phi-4 censored?

Phi-4 is not inherently censored, but its outputs can be filtered based on the implementation and configuration settings.

Is Phi-4 commercial-use allowed?

Yes, Phi-4 is licensed under the MIT License, which allows for commercial use without restriction.

Phi-4 context length?

Phi-4 has a context length of 16,384 tokens, allowing it to handle longer sequences of text effectively.

Want personalized recommendations for your exact setup? Detect my hardware →