Instructions to use trdgl/gemma4-26b-a4b-qa-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use trdgl/gemma4-26b-a4b-qa-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="trdgl/gemma4-26b-a4b-qa-GGUF", filename="gemma4-26b-a4b-qa.Q3_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use trdgl/gemma4-26b-a4b-qa-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf trdgl/gemma4-26b-a4b-qa-GGUF:Q3_K_M # Run inference directly in the terminal: llama cli -hf trdgl/gemma4-26b-a4b-qa-GGUF:Q3_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf trdgl/gemma4-26b-a4b-qa-GGUF:Q3_K_M # Run inference directly in the terminal: llama cli -hf trdgl/gemma4-26b-a4b-qa-GGUF:Q3_K_M
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 trdgl/gemma4-26b-a4b-qa-GGUF:Q3_K_M # Run inference directly in the terminal: ./llama-cli -hf trdgl/gemma4-26b-a4b-qa-GGUF:Q3_K_M
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 trdgl/gemma4-26b-a4b-qa-GGUF:Q3_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf trdgl/gemma4-26b-a4b-qa-GGUF:Q3_K_M
Use Docker
docker model run hf.co/trdgl/gemma4-26b-a4b-qa-GGUF:Q3_K_M
- LM Studio
- Jan
- vLLM
How to use trdgl/gemma4-26b-a4b-qa-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "trdgl/gemma4-26b-a4b-qa-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trdgl/gemma4-26b-a4b-qa-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/trdgl/gemma4-26b-a4b-qa-GGUF:Q3_K_M
- Ollama
How to use trdgl/gemma4-26b-a4b-qa-GGUF with Ollama:
ollama run hf.co/trdgl/gemma4-26b-a4b-qa-GGUF:Q3_K_M
- Unsloth Studio
How to use trdgl/gemma4-26b-a4b-qa-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for trdgl/gemma4-26b-a4b-qa-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for trdgl/gemma4-26b-a4b-qa-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for trdgl/gemma4-26b-a4b-qa-GGUF to start chatting
- Atomic Chat new
- Docker Model Runner
How to use trdgl/gemma4-26b-a4b-qa-GGUF with Docker Model Runner:
docker model run hf.co/trdgl/gemma4-26b-a4b-qa-GGUF:Q3_K_M
- Lemonade
How to use trdgl/gemma4-26b-a4b-qa-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull trdgl/gemma4-26b-a4b-qa-GGUF:Q3_K_M
Run and chat with the model
lemonade run user.gemma4-26b-a4b-qa-GGUF-Q3_K_M
List all available models
lemonade list
Gemma 4 26B-A4B fine-tuned for PyTorch API testing โ GGUF
Fine-tuned google/gemma-4-26B-A4B-it for generating small Python programs that exercise PyTorch APIs on tiny tensors. Quantized to GGUF for inference with llama.cpp / llama-cpp-python.
Files
| File | Quant | Size (approx.) | Suitable hardware |
|---|---|---|---|
gemma4-26b-a4b-qa.Q3_K_M.gguf |
Q3_K_M | ~13 GB | Colab T4 16GB (full GPU) |
gemma4-26b-a4b-qa.Q4_K_M.gguf |
Q4_K_M | ~17 GB | A100 40GB / T4 with offload |
Training summary
- Base model:
google/gemma-4-26B-A4B-it(MoE, ~4B active params) - Method: QLoRA 4-bit (nf4) + TRL
SFTTrainerwithassistant_only_loss=True - LoRA: r=16, alpha=32, target=all-linear, dropout 0
- Dataset: 1443 synthetic instruction/output pairs derived from PyTorch API metadata (DFUZZ-style)
- Hyperparameters: 2 epochs, batch 1 x grad-accum 8, lr 1e-4, cosine schedule, warmup 20 steps
- Hardware / time: NVIDIA H200, ~28 minutes
- Final eval_loss: 0.150 (mean_token_accuracy ~95%)
Prompt format (Gemma chat template)
<bos><start_of_turn>system
You are a PyTorch API testing assistant. Given a PyTorch API name, signature, and docstring, generate a small, deterministic Python program that exercises this API on tiny tensors. Output only Python code.<end_of_turn>
<start_of_turn>user
Muc tieu API: torch.matmul
Thong tin: {'input': 'Tensor', 'other': 'Tensor'}
Mo ta chi tiet: Matrix product of two tensors.
Hay viet ma Python kiem thu API nay.<end_of_turn>
<start_of_turn>model
Output is a single short Python snippet that imports torch, builds tiny tensors, calls the target API, and prints results.
Usage with llama-cpp-python
from llama_cpp import Llama
llm = Llama.from_pretrained(
repo_id="trdgl/gemma4-26b-a4b-qa-GGUF",
filename="gemma4-26b-a4b-qa.Q3_K_M.gguf",
n_ctx=2048,
n_gpu_layers=-1,
verbose=False,
)
SYSTEM = (
"You are a PyTorch API testing assistant. "
"Given a PyTorch API name, signature, and docstring, "
"generate a small, deterministic Python program that exercises "
"this API on tiny tensors. Output only Python code."
)
out = llm.create_chat_completion(
messages=[
{"role": "system", "content": SYSTEM},
{"role": "user", "content":
"Muc tieu API: torch.matmul\n"
"Thong tin: {'input': 'Tensor', 'other': 'Tensor'}\n"
"Mo ta chi tiet: Matrix product of two tensors.\n"
"Hay viet ma Python kiem thu API nay."},
],
max_tokens=300,
temperature=0.0,
stop=["<end_of_turn>", "<start_of_turn>"],
)
print(out["choices"][0]["message"]["content"])
Speed reference
| Hardware | Quant | Speed |
|---|---|---|
| NVIDIA H200 | Q3_K_M / Q4_K_M | ~140-160 tok/s |
| Colab T4 16GB | Q3_K_M (full GPU) | ~15-25 tok/s |
| Colab T4 16GB | Q4_K_M (with offload) | ~8-15 tok/s |
Notes
- Stop tokens recommended:
<end_of_turn>,<start_of_turn>. - LoRA adapter (~250 MB) is included under
adapter/for further stacking or full-precision merging. - This GGUF chat template was patched to remove training-specific markers; standard llama.cpp loaders work without overrides.
License
Model weights are subject to the Gemma Terms of Use. The LoRA adapter and conversion code are released under Apache-2.0.
- Downloads last month
- 29
3-bit
4-bit