Instructions to use Yanun/Swift-Qwen3.8-27b-oQ4e-fp16-mtp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Yanun/Swift-Qwen3.8-27b-oQ4e-fp16-mtp 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("Yanun/Swift-Qwen3.8-27b-oQ4e-fp16-mtp") config = load_config("Yanun/Swift-Qwen3.8-27b-oQ4e-fp16-mtp") # 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
- Pi
How to use Yanun/Swift-Qwen3.8-27b-oQ4e-fp16-mtp with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Yanun/Swift-Qwen3.8-27b-oQ4e-fp16-mtp"
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": "Yanun/Swift-Qwen3.8-27b-oQ4e-fp16-mtp" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use Yanun/Swift-Qwen3.8-27b-oQ4e-fp16-mtp 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 "Yanun/Swift-Qwen3.8-27b-oQ4e-fp16-mtp"
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 Yanun/Swift-Qwen3.8-27b-oQ4e-fp16-mtp
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Yanun/Swift-Qwen3.8-27b-oQ4e-fp16-mtp with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Yanun/Swift-Qwen3.8-27b-oQ4e-fp16-mtp"
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 "Yanun/Swift-Qwen3.8-27b-oQ4e-fp16-mtp" \ --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"
Replace model description with architecture and precision details
Browse files
README.md
CHANGED
|
@@ -15,11 +15,32 @@ tags:
|
|
| 15 |
|
| 16 |
# Swift-Qwen3.8-27b-oQ4e-fp16-mtp
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
## Source and license
|
| 25 |
|
|
|
|
| 15 |
|
| 16 |
# Swift-Qwen3.8-27b-oQ4e-fp16-mtp
|
| 17 |
|
| 18 |
+
## Model architecture
|
| 19 |
|
| 20 |
+
A 27B-class dense multimodal model stored in MLX format. It contains a text backbone, a vision encoder, and one multi-token prediction (MTP) layer.
|
| 21 |
|
| 22 |
+
| Component | Structure |
|
| 23 |
+
|---|---|
|
| 24 |
+
| Text backbone | 64 layers; hidden size 5,120; feed-forward size 17,408 |
|
| 25 |
+
| Attention layout | 48 linear-attention layers and 16 full-attention layers, with full attention every fourth layer |
|
| 26 |
+
| Full attention | 24 query heads, 4 key/value heads, head dimension 256 |
|
| 27 |
+
| Vocabulary | 248,320 tokens |
|
| 28 |
+
| Configured context limit | 262,144 tokens; usable length depends on runtime settings and available memory |
|
| 29 |
+
| Vision encoder | 27 layers; hidden size 1,152; 16 attention heads; 16 × 16 image patches |
|
| 30 |
+
| Vision-to-text connection | Vision features are projected to the text hidden size of 5,120 |
|
| 31 |
+
| MTP | One additional prediction layer with attention and feed-forward projections |
|
| 32 |
+
|
| 33 |
+
## Weight precision
|
| 34 |
+
|
| 35 |
+
The oQ4e checkpoint uses mixed precision rather than uniform 4-bit weights:
|
| 36 |
+
|
| 37 |
+
- The default quantization is **4-bit affine**, with **64 values per group**.
|
| 38 |
+
- **187 modules** have explicit **5-bit** overrides in `config.json`.
|
| 39 |
+
- The MTP layer's seven large attention and feed-forward matrices use **4-bit** weights.
|
| 40 |
+
- The MTP fusion matrix (`mtp.fc`) and normalization weights remain **FP16**. The fusion matrix maps 10,240 input features to 5,120 output features.
|
| 41 |
+
- The MTP quantization scales and offsets are stored in **FP16**.
|
| 42 |
+
|
| 43 |
+
The `fp16` suffix describes the retained floating-point precision; it does not mean the entire model or MTP layer is FP16. Exact per-module settings are recorded in `config.json`.
|
| 44 |
|
| 45 |
## Source and license
|
| 46 |
|