Instructions to use jxx123/loop-qwen35-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use jxx123/loop-qwen35-4b with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf jxx123/loop-qwen35-4b:F16 # Run inference directly in the terminal: llama cli -hf jxx123/loop-qwen35-4b:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf jxx123/loop-qwen35-4b:F16 # Run inference directly in the terminal: llama cli -hf jxx123/loop-qwen35-4b:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf jxx123/loop-qwen35-4b:F16 # Run inference directly in the terminal: ./llama-cli -hf jxx123/loop-qwen35-4b:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf jxx123/loop-qwen35-4b:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf jxx123/loop-qwen35-4b:F16
Use Docker
docker model run hf.co/jxx123/loop-qwen35-4b:F16
- LM Studio
- Jan
- Ollama
How to use jxx123/loop-qwen35-4b with Ollama:
ollama run hf.co/jxx123/loop-qwen35-4b:F16
- Unsloth Studio
How to use jxx123/loop-qwen35-4b with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for jxx123/loop-qwen35-4b to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for jxx123/loop-qwen35-4b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for jxx123/loop-qwen35-4b to start chatting
- Pi
How to use jxx123/loop-qwen35-4b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf jxx123/loop-qwen35-4b:F16
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "jxx123/loop-qwen35-4b:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use jxx123/loop-qwen35-4b with Docker Model Runner:
docker model run hf.co/jxx123/loop-qwen35-4b:F16
- Lemonade
How to use jxx123/loop-qwen35-4b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull jxx123/loop-qwen35-4b:F16
Run and chat with the model
lemonade run user.loop-qwen35-4b-F16
List all available models
lemonade list
- Hermes Agent
How to use jxx123/loop-qwen35-4b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf jxx123/loop-qwen35-4b:F16
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 jxx123/loop-qwen35-4b:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use jxx123/loop-qwen35-4b with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf jxx123/loop-qwen35-4b:F16
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 "jxx123/loop-qwen35-4b:F16" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
loop-qwen35-4b — Qwen3.5-4B closed-loop insulin controller (Gemini-distilled)
A Qwen3.5-4B model LoRA-distilled from a gemini-3-flash-preview insulin-control
policy for closed-loop type-1-diabetes control in the simglucose simulator.
It emits the next basal/bolus action chunk (with a short clinical rationale) from a
rolling CGM/insulin/carb history + a deterministically-computed insulin-on-board.
Result (held-out 9 patients, 48 h, seed 42)
| meals | model | TIR (70–180) | TBR (<70) | survived |
|---|---|---|---|---|
| announced | v15 (Qwen3-4B) | 68.8 | 13.2 | 7/9 |
| announced | this (Qwen3.5-4B) | 80.8 | 2.1 | 9/9 |
| unannounced | v15 | 68.9 | 10.3 | 8/9 |
| unannounced | this | 73.8 | 2.2 | 9/9 |
| unannounced | Gemini teacher | 73.9 | 3.0 | 9/9 |
- 9/9 survival in both conditions — matches the Gemini teacher; unannounced TIR ≈ teacher parity. The base-model upgrade from Qwen3-4B (v15) collapsed the pediatric over-dosing (TBR 13/10 → ~2 %) and saved the hardest patient (child#008).
- Eval is bf16 on A100 (single seed); Q4_K_M deployment verified surviving on the decisive hard case.
Files
adapter_model.safetensors— LoRA adapter (rank 32,all-lineartargets; the hybrid linear-attention layers needall-linear). Merge ontoQwen/Qwen3.5-4B.*-f16.gguf— merged f16 GGUF, already patched for llama.cpp/Ollama (Qwen3.5's phantom MTP block removed:block_count−1,nextn_predict_layers=0). Quantize + serve:ollama create loop-qwen35 --quantize q4_K_M -f Modelfile(needs Ollama ≥ 0.32). Modelfile:FROM *-f16.gguf/TEMPLATE {{ .Prompt }}/PARAMETER num_ctx 4096/PARAMETER temperature 0.
Training
transformers 5.x + torch 2.6 (matched torchvision/torchaudio), LoRA r32
target_modules=all-linear, 2 epochs, eff. batch 32, lr 2e-4, max-seq 4096.
Data: jxx123/loop-qwen-v8-sft (distill_sft_v16.jsonl). Reason-before-act
(concise clinical rationale) output format. Trained on 21 non-held-out patients only.
⚠️ Research / simulation only — not a medical device.
- Downloads last month
- 2
16-bit