Instructions to use Ry682/qvex-q4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Ry682/qvex-q4 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("Ry682/qvex-q4") 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 Ry682/qvex-q4 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Ry682/qvex-q4"
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": "Ry682/qvex-q4" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use Ry682/qvex-q4 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Ry682/qvex-q4"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Ry682/qvex-q4" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ry682/qvex-q4", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use Ry682/qvex-q4 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 "Ry682/qvex-q4"
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 Ry682/qvex-q4
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Ry682/qvex-q4 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Ry682/qvex-q4"
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 "Ry682/qvex-q4" \ --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"
qvex-q4
A 4-bit MLX quantization of Qwen/Qwen3.5-9B, built with an importance matrix (imatrix) for the QVex inference engine.
Each matrix is quantized from the original bf16 weights, weighting input channels by how active they are on real text (Italian, English, code, chat). The format is standard MLX 4-bit, so it has the same size, speed and memory as the stock MLX 4-bit.
Results
Measured on 40 held-out windows (never used for calibration), KL against the original bf16 model, on a MacBook Air M5 (16 GB):
| Model | KL ↓ | Same top token | Perplexity |
|---|---|---|---|
| bf16 original | 0 | 100% | 5.75 |
| qvex-q4 | 0.026 | 91.9% | 5.89 |
| LM Studio MLX 4-bit | 0.069 | 86.7% | 5.98 |
The largest gain is on Italian text (KL 0.029 vs 0.084). The task check used only 24 verifiable tasks, so treat it as a sanity check rather than a benchmark. Everything was tested on one machine.
Usage
The model is designed for QVex. See the repository for the engine, the quantization pipeline (quant/) and how to rebuild it.
License
Apache-2.0, inherited from Qwen3.5-9B.
- Downloads last month
- -
4-bit