Instructions to use JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M 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("JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M") 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
- Pi
How to use JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Revert incorrect looping-fix banner — mlx_lm already handles multi-eos from generation_config.json
Browse files
README.md
CHANGED
|
@@ -9,33 +9,18 @@ tags:
|
|
| 9 |
pipeline_tag: text-generation
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
| 13 |
-
>
|
| 14 |
-
> **Fixed 2026-04-13.** Earlier versions of this repo had a tokenizer bug that caused the model to **loop forever** in stock `mlx_lm` and other loaders.
|
| 15 |
-
>
|
| 16 |
-
> **Gemma-4 emits `<end_of_turn>` (id 106) at the end of an assistant turn**, but the original `tokenizer_config.json` only listed `<eos>` (id 1) as the stop token. Stock loaders never detected the actual end-of-turn marker → infinite loop.
|
| 17 |
-
>
|
| 18 |
-
> ## How to fix:
|
| 19 |
-
>
|
| 20 |
-
> ### Option A — Re-download just the tokenizer config (fastest)
|
| 21 |
-
> ```bash
|
| 22 |
-
> huggingface-cli download JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M tokenizer_config.json --local-dir ./your-model-dir
|
| 23 |
-
> ```
|
| 24 |
-
>
|
| 25 |
-
> ### Option B — Re-download the whole repo
|
| 26 |
-
> ```bash
|
| 27 |
-
> huggingface-cli download JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M --local-dir ./your-model-dir
|
| 28 |
-
> ```
|
| 29 |
-
>
|
| 30 |
-
> ### Option C — Pass the stop tokens manually
|
| 31 |
-
> ```python
|
| 32 |
-
> stop_token_ids = [1, 106, 50] # <eos>, <end_of_turn>, <end_of_image>
|
| 33 |
-
> ```
|
| 34 |
-
>
|
| 35 |
-
> **The model weights are unchanged — you only need to update `tokenizer_config.json`.**
|
| 36 |
|
| 37 |
-
--
|
| 38 |
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
-
|
|
|
|
| 9 |
pipeline_tag: text-generation
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Gemma-4-26B-A4B-it-JANG_4M
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
JANG-quantized Gemma-4 MoE for Apple Silicon. Created by Jinho Jang — eric@jangq.ai.
|
| 15 |
|
| 16 |
+
See the full [JANGQ-AI collection](https://huggingface.co/JANGQ-AI) for all profiles.
|
| 17 |
+
|
| 18 |
+
## Loading
|
| 19 |
+
|
| 20 |
+
```python
|
| 21 |
+
from mlx_lm import load, generate
|
| 22 |
+
model, tokenizer = load("JANGQ-AI/Gemma-4-26B-A4B-it-JANG_4M")
|
| 23 |
+
print(generate(model, tokenizer, "Hello", max_tokens=256))
|
| 24 |
+
```
|
| 25 |
|
| 26 |
+
Stock `mlx_lm` picks up the multi-stop-token list (`[1, 106, 50]`) automatically from `generation_config.json` — no manual configuration required.
|