Text Generation
Transformers
Safetensors
GGUF
English
gemma3
q4-k-m
tinygemma
tinystories
validation
test-suite
Instructions to use shibatch/tinygemma3-2m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shibatch/tinygemma3-2m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="shibatch/tinygemma3-2m")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("shibatch/tinygemma3-2m", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use shibatch/tinygemma3-2m 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 shibatch/tinygemma3-2m:Q4_K_M # Run inference directly in the terminal: llama cli -hf shibatch/tinygemma3-2m:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf shibatch/tinygemma3-2m:Q4_K_M # Run inference directly in the terminal: llama cli -hf shibatch/tinygemma3-2m:Q4_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 shibatch/tinygemma3-2m:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf shibatch/tinygemma3-2m:Q4_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 shibatch/tinygemma3-2m:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf shibatch/tinygemma3-2m:Q4_K_M
Use Docker
docker model run hf.co/shibatch/tinygemma3-2m:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use shibatch/tinygemma3-2m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shibatch/tinygemma3-2m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shibatch/tinygemma3-2m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/shibatch/tinygemma3-2m:Q4_K_M
- SGLang
How to use shibatch/tinygemma3-2m with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "shibatch/tinygemma3-2m" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shibatch/tinygemma3-2m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "shibatch/tinygemma3-2m" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shibatch/tinygemma3-2m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use shibatch/tinygemma3-2m with Ollama:
ollama run hf.co/shibatch/tinygemma3-2m:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use shibatch/tinygemma3-2m with Docker Model Runner:
docker model run hf.co/shibatch/tinygemma3-2m:Q4_K_M
- Lemonade
How to use shibatch/tinygemma3-2m with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull shibatch/tinygemma3-2m:Q4_K_M
Run and chat with the model
lemonade run user.tinygemma3-2m-Q4_K_M
List all available models
lemonade list
- Atomic Chat
| { | |
| "source": { | |
| "repo_id": "shibatch/tinygemma3-2m", | |
| "revision": "7aab2f4e525707e046799eb5674f344dc74853d6", | |
| "downloaded_utc_date": "2026-08-13" | |
| }, | |
| "conversion": { | |
| "script": "convert_to_gguf.py", | |
| "llama_cpp_source_id": "0b1bad14ff204627636aeb1de22ddcd5acb859d4", | |
| "intermediate_type": "F16", | |
| "quantizer": "llama.cpp 8681 (Debian)", | |
| "requested_quantization": "Q4_K_M", | |
| "general_file_type": 15, | |
| "tensor_count": 80, | |
| "tensor_type_counts": { | |
| "F32": 37, | |
| "Q5_0": 34, | |
| "Q4_K": 4, | |
| "Q8_0": 3, | |
| "Q6_K": 2 | |
| }, | |
| "fallback_quantized_tensor_count": 36, | |
| "tokenizer_pre": "gpt-2", | |
| "tokenizer_probe_sha256": "a7cd49e25128643b1b7df2df3a699e60225476307c755f246cacfd441d533a7b", | |
| "padded_vocab_rows_preserved": 1024 | |
| }, | |
| "output": { | |
| "path": "gguf/tinygemma3-2m-Q4_K_M.gguf", | |
| "size_bytes": 1153312, | |
| "sha256": "54e9a48a7d571b01e291f897ac03953b3aae3ab76acfd4d7e3d314f7efc47644" | |
| }, | |
| "validation": { | |
| "runtime": "llama.cpp 8681 (Debian)", | |
| "load_succeeded": true, | |
| "generation_exit_code": 0, | |
| "prompt": "Once upon", | |
| "max_new_tokens": 40, | |
| "temperature": 0.0, | |
| "completion": " a time, there was a little girl named Lily. She loved to play with her toys and her favorite thing to do was to go to the park. One day, Lily's" | |
| } | |
| } | |