Instructions to use mlx-community/gemma-3-27b-pt-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mlx-community/gemma-3-27b-pt-8bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="mlx-community/gemma-3-27b-pt-8bit")# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("mlx-community/gemma-3-27b-pt-8bit") model = AutoModelForMultimodalLM.from_pretrained("mlx-community/gemma-3-27b-pt-8bit", device_map="auto") - MLX
How to use mlx-community/gemma-3-27b-pt-8bit with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("mlx-community/gemma-3-27b-pt-8bit") config = load_config("mlx-community/gemma-3-27b-pt-8bit") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- vLLM
How to use mlx-community/gemma-3-27b-pt-8bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mlx-community/gemma-3-27b-pt-8bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/gemma-3-27b-pt-8bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mlx-community/gemma-3-27b-pt-8bit
- SGLang
How to use mlx-community/gemma-3-27b-pt-8bit 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 "mlx-community/gemma-3-27b-pt-8bit" \ --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": "mlx-community/gemma-3-27b-pt-8bit", "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 "mlx-community/gemma-3-27b-pt-8bit" \ --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": "mlx-community/gemma-3-27b-pt-8bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mlx-community/gemma-3-27b-pt-8bit with Docker Model Runner:
docker model run hf.co/mlx-community/gemma-3-27b-pt-8bit
- Atomic Chat
Upload folder using huggingface_hub
Browse files- README.md +1 -1
- generation_config.json +8 -0
- model-00001-of-00006.safetensors +2 -2
- model-00002-of-00006.safetensors +2 -2
- model-00003-of-00006.safetensors +2 -2
- model-00004-of-00006.safetensors +2 -2
- model-00005-of-00006.safetensors +2 -2
- model-00006-of-00006.safetensors +2 -2
- model.safetensors.index.json +0 -0
- processor_config.json +4 -0
README.md
CHANGED
|
@@ -12,7 +12,7 @@ tags:
|
|
| 12 |
---
|
| 13 |
|
| 14 |
# mlx-community/gemma-3-27b-pt-8bit
|
| 15 |
-
This model was converted to MLX format from [`google/gemma-3-27b-pt`]() using mlx-vlm version **0.1.
|
| 16 |
Refer to the [original model card](https://huggingface.co/google/gemma-3-27b-pt) for more details on the model.
|
| 17 |
## Use with mlx
|
| 18 |
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
# mlx-community/gemma-3-27b-pt-8bit
|
| 15 |
+
This model was converted to MLX format from [`google/gemma-3-27b-pt`]() using mlx-vlm version **0.1.18**.
|
| 16 |
Refer to the [original model card](https://huggingface.co/google/gemma-3-27b-pt) for more details on the model.
|
| 17 |
## Use with mlx
|
| 18 |
|
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 |
+
}
|
model-00001-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:06423ed600bd8d7365d3f67a5b264976083cebb96c72e5f68f6cd704a641559d
|
| 3 |
+
size 5279750284
|
model-00002-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:60b5120e18fcb6044b798ae283f3a00bd6b56f214b9842f84ec597072c25fa33
|
| 3 |
+
size 5264743530
|
model-00003-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f947aa32476a21e0f472e4247b14144d48386a7edc02805d8d7af92419de7dfa
|
| 3 |
+
size 5264743642
|
model-00004-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a019b479c3aea8b4e316a41570fc649a691f52351c7cf26db4e2bfb8efb2227d
|
| 3 |
+
size 5264743640
|
model-00005-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c71103fc438d1369c59853ef2cd9cd3f902b76f7cd46bce6f19f21d7ea85428a
|
| 3 |
+
size 5264743646
|
model-00006-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5aebaa611f57538fdcf6036f8882215bfdb8315f35b2c1af1feb152fe4f072bd
|
| 3 |
+
size 4704107440
|
model.safetensors.index.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
processor_config.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_seq_length": 256,
|
| 3 |
+
"processor_class": "Gemma3Processor"
|
| 4 |
+
}
|