Instructions to use ukisai/Swift-1.5-4bit-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use ukisai/Swift-1.5-4bit-MLX 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("ukisai/Swift-1.5-4bit-MLX") 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 ukisai/Swift-1.5-4bit-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "ukisai/Swift-1.5-4bit-MLX"
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": "ukisai/Swift-1.5-4bit-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use ukisai/Swift-1.5-4bit-MLX with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "ukisai/Swift-1.5-4bit-MLX"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "ukisai/Swift-1.5-4bit-MLX" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ukisai/Swift-1.5-4bit-MLX", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use ukisai/Swift-1.5-4bit-MLX 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 "ukisai/Swift-1.5-4bit-MLX"
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 ukisai/Swift-1.5-4bit-MLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use ukisai/Swift-1.5-4bit-MLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "ukisai/Swift-1.5-4bit-MLX"
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 "ukisai/Swift-1.5-4bit-MLX" \ --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"
File size: 1,924 Bytes
9fd3d5f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | {
"status": "PASS_MAC_NATIVE_MLX_FORMAT_AND_REAL_METAL_SAMPLES",
"platform": "macOS-26.6-arm64-arm-64bit",
"machine": "arm64",
"mlx": "0.32.2",
"mlx_lm": "0.32.0",
"device": "Device(gpu, 0)",
"quantization": {
"group_size": 64,
"bits": 4,
"mode": "affine"
},
"all_saved_tensor_headers_validated": 2379,
"all_source_parameters_accounted_for": 1199,
"strict_complete_parameter_tree": "PASS using unevaluated header fixtures; no fabricated weights saved",
"actual_checkpoint_samples": [
{
"sample": 0,
"category": "text",
"checkpoint_weight": "language_model.model.layers.0.linear_attn.in_proj_a.weight",
"original_shape": [
48,
5120
],
"packed_shape": [
48,
640
],
"native_metal_bf16": "PASS",
"metal_fp32": "PASS",
"bf16_max_absolute_error": 0.0004401206970214844,
"fp32_max_absolute_error": 0.0
},
{
"sample": 1,
"category": "vision",
"checkpoint_weight": "visual.blocks.0.attn.proj.weight",
"original_shape": [
1152,
1152
],
"packed_shape": [
1152,
144
],
"native_metal_bf16": "PASS",
"metal_fp32": "PASS",
"bf16_max_absolute_error": 0.0002315044403076172,
"fp32_max_absolute_error": 0.0
},
{
"sample": 2,
"category": "MTP",
"checkpoint_weight": "mtp.layers.0.self_attn.k_proj.weight",
"original_shape": [
1024,
5120
],
"packed_shape": [
1024,
640
],
"native_metal_bf16": "PASS",
"metal_fp32": "PASS",
"bf16_max_absolute_error": 0.0009589195251464844,
"fp32_max_absolute_error": 0.0
}
],
"full_model_mac_generation": "NOT_RUN: targeted native Metal format and real-weight component checks only",
"peak_mlx_bytes": 4597960,
"peak_process_rss_bytes": 360693760
}
|