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 Studio
How to use shibatch/tinygemma3-2m 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 shibatch/tinygemma3-2m 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 shibatch/tinygemma3-2m to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for shibatch/tinygemma3-2m to start chatting
- 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
File size: 1,723 Bytes
4af09c3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | {
"short": {
"input_ids": [
[
1000,
10,
20,
30,
1001
]
],
"logits_shape": [
1,
5,
1024
],
"last_token_first_logits": [
1.6521029472351074,
1.4642627239227295,
-9.5765380859375,
-7.363133907318115,
-9.31251049041748,
-8.014636993408203,
-0.9056704044342041,
-4.061333656311035,
-7.719905376434326,
-6.023119926452637,
-6.828976631164551,
6.4113569259643555,
1.9600541591644287,
1.8930537700653076,
-5.919459342956543,
-6.127346992492676
]
},
"window_crossing": {
"input_ids": [
[
1000,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
1001
]
],
"logits_shape": [
1,
42,
1024
],
"last_token_first_logits": [
1.7217341661453247,
1.7506439685821533,
-10.329566955566406,
-8.427742958068848,
-9.419321060180664,
-7.354942798614502,
-1.3027912378311157,
-5.214502811431885,
-7.691402435302734,
-6.378243446350098,
-8.10946273803711,
6.727044582366943,
1.3272100687026978,
2.51751446723938,
-7.086978912353516,
-6.290528297424316
]
}
} |