Text Generation
Transformers
Safetensors
GGUF
English
gemma3_text
text-generation-inference
unsloth
gemma3
conversational
Instructions to use cassioblaz/gemma3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cassioblaz/gemma3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cassioblaz/gemma3") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cassioblaz/gemma3") model = AutoModelForCausalLM.from_pretrained("cassioblaz/gemma3") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use cassioblaz/gemma3 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="cassioblaz/gemma3", filename="gemma3.Q8_0.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use cassioblaz/gemma3 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf cassioblaz/gemma3:Q8_0 # Run inference directly in the terminal: llama-cli -hf cassioblaz/gemma3:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf cassioblaz/gemma3:Q8_0 # Run inference directly in the terminal: llama-cli -hf cassioblaz/gemma3:Q8_0
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 cassioblaz/gemma3:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf cassioblaz/gemma3:Q8_0
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 cassioblaz/gemma3:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf cassioblaz/gemma3:Q8_0
Use Docker
docker model run hf.co/cassioblaz/gemma3:Q8_0
- LM Studio
- Jan
- vLLM
How to use cassioblaz/gemma3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cassioblaz/gemma3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cassioblaz/gemma3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cassioblaz/gemma3:Q8_0
- SGLang
How to use cassioblaz/gemma3 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 "cassioblaz/gemma3" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cassioblaz/gemma3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "cassioblaz/gemma3" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cassioblaz/gemma3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use cassioblaz/gemma3 with Ollama:
ollama run hf.co/cassioblaz/gemma3:Q8_0
- Unsloth Studio new
How to use cassioblaz/gemma3 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 cassioblaz/gemma3 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 cassioblaz/gemma3 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for cassioblaz/gemma3 to start chatting
- Docker Model Runner
How to use cassioblaz/gemma3 with Docker Model Runner:
docker model run hf.co/cassioblaz/gemma3:Q8_0
- Lemonade
How to use cassioblaz/gemma3 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull cassioblaz/gemma3:Q8_0
Run and chat with the model
lemonade run user.gemma3-Q8_0
List all available models
lemonade list
(Trained with Unsloth)
Browse files- config.json +37 -0
- generation_config.json +8 -0
- tokenizer.model +3 -0
config.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Gemma3ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"attn_logit_softcapping": null,
|
| 8 |
+
"bos_token_id": 2,
|
| 9 |
+
"cache_implementation": "hybrid",
|
| 10 |
+
"eos_token_id": 1,
|
| 11 |
+
"final_logit_softcapping": null,
|
| 12 |
+
"head_dim": 256,
|
| 13 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 14 |
+
"hidden_size": 2560,
|
| 15 |
+
"initializer_range": 0.02,
|
| 16 |
+
"intermediate_size": 10240,
|
| 17 |
+
"max_position_embeddings": 131072,
|
| 18 |
+
"model_type": "gemma3_text",
|
| 19 |
+
"num_attention_heads": 8,
|
| 20 |
+
"num_hidden_layers": 34,
|
| 21 |
+
"num_key_value_heads": 4,
|
| 22 |
+
"pad_token_id": 0,
|
| 23 |
+
"query_pre_attn_scalar": 256,
|
| 24 |
+
"rms_norm_eps": 1e-06,
|
| 25 |
+
"rope_local_base_freq": 10000.0,
|
| 26 |
+
"rope_scaling": {
|
| 27 |
+
"factor": 8.0,
|
| 28 |
+
"rope_type": "linear"
|
| 29 |
+
},
|
| 30 |
+
"rope_theta": 1000000.0,
|
| 31 |
+
"sliding_window": 1024,
|
| 32 |
+
"sliding_window_pattern": 6,
|
| 33 |
+
"torch_dtype": "float16",
|
| 34 |
+
"transformers_version": "4.50.0.dev0",
|
| 35 |
+
"use_cache": true,
|
| 36 |
+
"vocab_size": 262208
|
| 37 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 2,
|
| 4 |
+
"cache_implementation": "hybrid",
|
| 5 |
+
"eos_token_id": 1,
|
| 6 |
+
"pad_token_id": 0,
|
| 7 |
+
"transformers_version": "4.50.0.dev0"
|
| 8 |
+
}
|
tokenizer.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1299c11d7cf632ef3b4e11937501358ada021bbdf7c47638d13c0ee982f2e79c
|
| 3 |
+
size 4689074
|