Instructions to use badrm2611/scraper-agent-qwen3.5-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use badrm2611/scraper-agent-qwen3.5-4b 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("badrm2611/scraper-agent-qwen3.5-4b") 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 badrm2611/scraper-agent-qwen3.5-4b with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "badrm2611/scraper-agent-qwen3.5-4b"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "badrm2611/scraper-agent-qwen3.5-4b" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use badrm2611/scraper-agent-qwen3.5-4b with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "badrm2611/scraper-agent-qwen3.5-4b"
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 "badrm2611/scraper-agent-qwen3.5-4b" \ --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"
- MLX LM
How to use badrm2611/scraper-agent-qwen3.5-4b with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "badrm2611/scraper-agent-qwen3.5-4b"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "badrm2611/scraper-agent-qwen3.5-4b" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "badrm2611/scraper-agent-qwen3.5-4b", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use badrm2611/scraper-agent-qwen3.5-4b 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 "badrm2611/scraper-agent-qwen3.5-4b"
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 badrm2611/scraper-agent-qwen3.5-4b
Run Hermes
hermes
- Atomic Chat
scraper-agent-qwen3.5-4b
A Qwen3.5-4B fine-tune that acts as the policy for an autonomous web scraping agent. It reads a page observation and emits one JSON action: which tool to use, which element to act on, what it expects to happen, and how confident it is.
Built for badrmellal/scraper-agent. The model on its own is only half the system. The repo carries the observation scanner, the guards, and the grammar that make its output safe to execute.
What it is trained to do
Reason about pages by intent rather than by markup. The training corpus never contains a CSS selector, a class name, or a site-specific layout. It teaches:
- infer purpose from semantics, roles, labels and surrounding text, not from HTML
- treat every site as unknown, and reconnoitre before acting
- verify the outcome of an action instead of assuming it worked
- treat a failed action as an observation, not a terminal error
- resolve blocking layers before trying to reach content behind them
- keep going while records remain, and only conclude when the page is exhausted
Output is one JSON object per step, alphabetically keyed so the reasoning fields are generated before the decision fields:
{
"a_phase": "inspect",
"b_observed": "A list of records is visible, and a control suggests more pages.",
"c_inferred": "Reading the visible records is the capability I need now.",
"d_confidence": 0.9,
"e_tool": "extract"
}
Usage
This is served through MLX on Apple Silicon. It is not a chat model and expects the agent's system prompt and observation format.
git clone https://github.com/badrmellal/scraper-agent.git
cd scraper-agent
pip install -r requirements.txt
python3 -m playwright install chromium
hf download badrm2611/scraper-agent-qwen3.5-4b --local-dir ./models/scraper-v4
export SCRAPER_MLX_MODEL=$PWD/models/scraper-v4
python3 agent.py \
--goal "collect the title and price of every book in this category, all pages" \
--url "https://books.toscrape.com/catalogue/category/books/mystery_3/index.html" \
--scope "mystery_3" --fields "title,price" --budget 12
Benchmarks
Measured at BF16 against the agent harness.
| Task | This model | Stock Qwen3.5-4B |
|---|---|---|
| books.toscrape, single category, 2 pages | 32 / 32 | 32 / 32 |
| books.toscrape, deep crawl, 8 pages | 144 / 152 | not measured |
| seconds per step | 5 to 9 | 24 to 62 |
The stock base model reaches the same score on the simple benchmark. The difference is speed: a model trained on this action schema produces schema-valid JSON on a free decode, while a base model usually does not, so nearly every step falls back to grammar-constrained decoding, which is far slower.
Keep it at BF16
A 4-bit MLX quantization of these weights measured 12 / 32 against BF16's 32 / 32 on the same benchmark. It scrolled where it should have paginated, then declared itself finished. Re-run the benchmark before trusting any quantization.
Known limitation
GGUF conversions of these weights produce token salad under llama.cpp and Ollama at every quantization tested down to Q8_0, while the same weights served through MLX are correct. The cause was never isolated. Use MLX.
Training
QLoRA via Unsloth on Apple Silicon (MLX backend), from a corpus generated by applying
a hand-written reasoning doctrine to live pages. The doctrine is rules.json in the
repo, and make_dataset.py generates the corpus from it.
License
Apache 2.0, inherited from Qwen/Qwen3.5-4B.
- Downloads last month
- -
Quantized