How to use from
llama.cpp
Install from brew
brew install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf second-state/gemma-3-4b-it-GGUF:
# Run inference directly in the terminal:
llama-cli -hf second-state/gemma-3-4b-it-GGUF:
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf second-state/gemma-3-4b-it-GGUF:
# Run inference directly in the terminal:
llama-cli -hf second-state/gemma-3-4b-it-GGUF:
Use pre-built binary
# Download pre-built binary from:
# https://github.com/ggerganov/llama.cpp/releases
# Start a local OpenAI-compatible server with a web UI:
./llama-server -hf second-state/gemma-3-4b-it-GGUF:
# Run inference directly in the terminal:
./llama-cli -hf second-state/gemma-3-4b-it-GGUF:
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-server llama-cli
# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama-server -hf second-state/gemma-3-4b-it-GGUF:
# Run inference directly in the terminal:
./build/bin/llama-cli -hf second-state/gemma-3-4b-it-GGUF:
Use Docker
docker model run hf.co/second-state/gemma-3-4b-it-GGUF:
Quick Links

Gemma-3-4b-it-GGUF

Original Model

google/gemma-3-4b-it

Run with LlamaEdge

  • LlamaEdge version: v0.18.5 and above

  • Prompt template

    • Prompt type: gemma-3

    • Prompt string

      <bos><start_of_turn>user
      {user_message}<end_of_turn>
      <start_of_turn>model
      {model_message}<end_of_turn>model
      
  • Context size: 128000

  • Run as LlamaEdge service

    • Chat

      wasmedge --dir .:. --nn-preload default:GGML:AUTO:gemma-3-4b-it-Q5_K_M.gguf \
        llama-api-server.wasm \
        --prompt-template gemma-3 \
        --ctx-size 128000 \
        --model-name gemma-3-4b
      
    • Images

      Note that input images are required to be normalized to 896 x 896 resolution and encoded to 256 tokens each

      wasmedge --dir .:. --nn-preload default:GGML:AUTO:gemma-3-4b-it-Q5_K_M.gguf \
        llama-api-server.wasm \
        --prompt-template gemma-3 \
        --llava-mmproj gemma-3-4b-it-mmproj-f16.gguf \
        --ctx-size 128000 \
        --model-name gemma-3-4b
      
  • Run as LlamaEdge command app

    wasmedge --dir .:. \
      --nn-preload default:GGML:AUTO:gemma-3-4b-it-Q5_K_M.gguf \
      llama-chat.wasm \
      --prompt-template gemma-3 \
      --ctx-size 128000
    

Quantized GGUF Models

Name Quant method Bits Size Use case
gemma-3-4b-it-Q2_K.gguf Q2_K 2 1.73 GB smallest, significant quality loss - not recommended for most purposes
gemma-3-4b-it-Q3_K_L.gguf Q3_K_L 3 2.24 GB small, substantial quality loss
gemma-3-4b-it-Q3_K_M.gguf Q3_K_M 3 2.10 GB very small, high quality loss
gemma-3-4b-it-Q3_K_S.gguf Q3_K_S 3 1.94 GB very small, high quality loss
gemma-3-4b-it-Q4_0.gguf Q4_0 4 2.36 GB legacy; small, very high quality loss - prefer using Q3_K_M
gemma-3-4b-it-Q4_K_M.gguf Q4_K_M 4 2.49 GB medium, balanced quality - recommended
gemma-3-4b-it-Q4_K_S.gguf Q4_K_S 4 2.38 GB small, greater quality loss
gemma-3-4b-it-Q5_0.gguf Q5_0 5 2.76 GB legacy; medium, balanced quality - prefer using Q4_K_M
gemma-3-4b-it-Q5_K_M.gguf Q5_K_M 5 2.83 GB large, very low quality loss - recommended
gemma-3-4b-it-Q5_K_S.gguf Q5_K_S 5 2.76 GB large, low quality loss - recommended
gemma-3-4b-it-Q6_K.gguf Q6_K 6 3.19 GB very large, extremely low quality loss
gemma-3-4b-it-Q8_0.gguf Q8_0 8 4.13 GB very large, extremely low quality loss - not recommended
gemma-3-4b-it-f16.gguf f16 16 7.77 GB
gemma-3-4b-it-mmproj-f16.gguf f16 16 851 MB

Quantized with llama.cpp b4875

Downloads last month
1,172
GGUF
Model size
4B params
Architecture
gemma3
Hardware compatibility
Log In to add your hardware

2-bit

3-bit

4-bit

5-bit

6-bit

8-bit

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for second-state/gemma-3-4b-it-GGUF

Quantized
(462)
this model

Collection including second-state/gemma-3-4b-it-GGUF