Run this model with HF Jobs
Run 0xlean/Qwen3.8-27B-OpenCode-MLX-Q4 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/0xlean/Qwen3.8-27B-OpenCode-MLX-Q4. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/0xlean/Qwen3.8-27B-OpenCode-MLX-Q4 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/0xlean/Qwen3.8-27B-OpenCode-MLX-Q4. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use 0xlean/Qwen3.8-27B-OpenCode-MLX-Q4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use 0xlean/Qwen3.8-27B-OpenCode-MLX-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("0xlean/Qwen3.8-27B-OpenCode-MLX-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 0xlean/Qwen3.8-27B-OpenCode-MLX-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 "0xlean/Qwen3.8-27B-OpenCode-MLX-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": "0xlean/Qwen3.8-27B-OpenCode-MLX-Q4" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use 0xlean/Qwen3.8-27B-OpenCode-MLX-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 "0xlean/Qwen3.8-27B-OpenCode-MLX-Q4"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "0xlean/Qwen3.8-27B-OpenCode-MLX-Q4" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "0xlean/Qwen3.8-27B-OpenCode-MLX-Q4", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use 0xlean/Qwen3.8-27B-OpenCode-MLX-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 "0xlean/Qwen3.8-27B-OpenCode-MLX-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 0xlean/Qwen3.8-27B-OpenCode-MLX-Q4
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use 0xlean/Qwen3.8-27B-OpenCode-MLX-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 "0xlean/Qwen3.8-27B-OpenCode-MLX-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 "0xlean/Qwen3.8-27B-OpenCode-MLX-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"
File size: 5,884 Bytes
5fd670e | 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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | """Run a small, constrained OpenCode evaluation against a local MLX server."""
import argparse
import json
import os
from pathlib import Path
import subprocess
import sys
import tempfile
import time
from urllib.parse import urlsplit
TASKS = [
(
"empty-mean",
"def mean(values):\n return sum(values) / len(values)\n",
"Make mean return None for an empty list. Otherwise keep its arithmetic mean behavior.",
"assert mean([]) is None\nassert mean([2, 4]) == 3\nassert mean([-2, 2]) == 0",
),
(
"split-once",
"def parse(line):\n key, value = line.split('=')\n return key.strip(), value.strip()\n",
"Fix parse so only the first equals sign is a delimiter. Continue stripping whitespace from both sides.",
"assert parse(' x = a=b ') == ('x', 'a=b')\nassert parse('k=') == ('k', '')",
),
(
"stable-count",
"def count_by_key(keys):\n counts = {}\n for key in keys:\n counts[key] = 1\n return counts\n",
"Fix count_by_key so repeated keys are counted. Preserve first-seen key order and accept any iterable of keys.",
"assert list(count_by_key(iter('baab')).items()) == [('b', 2), ('a', 2)]\nassert count_by_key([]) == {}",
),
(
"adjacent-intervals",
"def overlaps(a, b):\n return a[0] <= b[1] and b[0] <= a[1]\n",
"Fix overlaps for half-open intervals [start, end). Adjacency and empty intervals must not count as overlap.",
"assert not overlaps((1, 2), (2, 3))\nassert not overlaps((2, 2), (1, 3))\nassert overlaps((1, 3), (2, 4))\nassert overlaps((1, 3), (1, 3))",
),
(
"page-count",
"def page_count(total, size):\n return total // size\n",
"Fix page_count to include a partial last page. Return zero for zero items and raise ValueError if size is not positive. Use integer arithmetic.",
"assert page_count(0, 4) == 0\nassert page_count(9, 4) == 3\nassert page_count(10**20 + 1, 10) == 10**19 + 1\ntry:\n page_count(5, 0)\nexcept ValueError:\n pass\nelse:\n raise AssertionError('expected ValueError')",
),
]
def evaluate(cli, base_url, limit):
with tempfile.TemporaryDirectory(prefix="qwen-eval-") as temporary:
root = Path(temporary).resolve()
env = {"PATH": os.environ["PATH"], "OPENCODE_DISABLE_AUTOUPDATE": "1"}
for key in ("CONFIG", "DATA", "CACHE", "STATE"):
env[f"XDG_{key}_HOME"] = str(root / key.lower())
env["HOME"] = os.environ["HOME"]
config = {
"provider": {
"local": {
"npm": "@ai-sdk/openai-compatible",
"options": {"baseURL": base_url, "apiKey": "dummy"},
"models": {"default_model": {"name": "Qwen comparison", "limit": {"context": 8192, "output": 1024}}},
}
},
"agent": {"build": {"temperature": 0, "steps": 8}},
}
for name, starter, task, tests in TASKS:
project = root / name
project.mkdir()
config["permissions"] = [
{"action": "*", "resource": "*", "effect": "deny"},
{"action": "read", "resource": "*solution.py", "effect": "allow"},
{"action": "edit", "resource": "*solution.py", "effect": "allow"},
]
(project / "opencode.json").write_text(json.dumps(config))
solution = project / "solution.py"
solution.write_text(starter)
prompt = f"Edit solution.py to satisfy this task. {task} Only edit solution.py."
start = time.monotonic()
try:
result = subprocess.run(
[cli, "run", "--standalone", "--model", "local/default_model", "--format", "json", prompt],
cwd=project, env=env, capture_output=True, text=True, timeout=limit,
)
except subprocess.TimeoutExpired as exc:
tail = (exc.stdout or b"").decode(errors="replace").splitlines()[-2:]
yield {"task": name, "status": "timeout", "seconds": limit, "details": " ".join(tail)[:700]}
continue
elapsed = round(time.monotonic() - start, 1)
events = []
for line in result.stdout.splitlines():
try:
events.append(json.loads(line))
except json.JSONDecodeError:
continue
if result.returncode or not events or any(event.get("type") == "error" for event in events):
details = next((event for event in events if event.get("type") == "error"), result.stderr)
yield {"task": name, "status": "cli_error", "seconds": elapsed, "details": str(details)[:600]}
continue
checked = subprocess.run(
[sys.executable, "-I", "-c", solution.read_text() + "\n" + tests],
cwd=project, env=env, capture_output=True, timeout=10,
)
yield {
"task": name,
"status": "pass" if checked.returncode == 0 else "fail",
"seconds": elapsed,
"tool_events": sum(event.get("type") == "tool_use" for event in events),
}
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("opencode", help="Path to the OpenCode CLI")
parser.add_argument("--base-url", default="http://127.0.0.1:8000/v1")
parser.add_argument("--time-limit", type=int, default=120)
args = parser.parse_args()
if urlsplit(args.base_url).hostname not in {"localhost", "127.0.0.1", "::1"}:
parser.error("--base-url must point to a loopback address")
for row in evaluate(args.opencode, args.base_url, args.time_limit):
print(json.dumps(row), flush=True)
|