Instructions to use Roxas13/gemma3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Roxas13/gemma3 with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("Roxas13/gemma3") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use Roxas13/gemma3 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Roxas13/gemma3"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Roxas13/gemma3" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Roxas13/gemma3", "messages": [ {"role": "user", "content": "Hello"} ] }'
| { | |
| "architectures": [ | |
| "Gemma3ForConditionalGeneration" | |
| ], | |
| "boi_token_index": 255999, | |
| "eoi_token_index": 256000, | |
| "eos_token_id": [ | |
| 1, | |
| 106 | |
| ], | |
| "image_token_index": 262144, | |
| "initializer_range": 0.02, | |
| "mm_tokens_per_image": 256, | |
| "model_type": "gemma3", | |
| "quantization": { | |
| "group_size": 64, | |
| "bits": 4 | |
| }, | |
| "quantization_config": { | |
| "group_size": 64, | |
| "bits": 4 | |
| }, | |
| "text_config": { | |
| "hidden_size": 2560, | |
| "intermediate_size": 10240, | |
| "model_type": "gemma3_text", | |
| "num_hidden_layers": 34, | |
| "rope_scaling": { | |
| "factor": 8.0, | |
| "rope_type": "linear" | |
| }, | |
| "sliding_window": 1024, | |
| "vocab_size": 262208, | |
| "num_attention_heads": 8, | |
| "num_key_value_heads": 4 | |
| }, | |
| "torch_dtype": "bfloat16", | |
| "transformers_version": "4.50.0.dev0" | |
| } |