🧠 microclaw-for-openclaw – Enhanced Fallback Agent for OpenClaw (v2026.2.17)
Model ID: webxos/microclaw-for-openclaw-version-2026.2.17
Tags: openclaw, fallback-agent, grpo, vae, kv-cache, dpo, tool-masking, uncertainty, rag, semantic-cache, soul.md, huggingface-space, gguf, llm-distillation
📌 Overview
microclaw (v2026.2.17) is a lightweight, distilled language model designed as a fallback agent for the OpenClaw ecosystem. When the primary agent loses connectivity or requires offline operation, microclaw steps in to handle essential system tasks: file management, status checks, cron jobs, and simple Q&A.
This version introduces advanced training and inference enhancements:
- Tool‑use masking and schema‑first training for reliable function calling.
- Direct Preference Optimization (DPO) to align outputs with human preferences.
- Uncertainty estimation with configurable thresholds for safe escalation.
- Retrieval‑Augmented Generation (RAG) with semantic chunking.
- Semantic KV‑cache for high‑similarity query reuse.
- Quantization (down to 2‑bit) and pruning for extreme memory efficiency.
The repository contains the fully trained model files, configuration (soul.md, AGENTS.md, HEARTBEAT.md, SECURITY.md), and export bundles ready for deployment to Hugging Face Spaces or local execution with OpenClaw.
✨ Key Features
- GRPO (Group Relative Policy Optimization) – Trains the agent with group‑wise advantage estimation for stable policy updates.
- VAE Filter – A Variational Autoencoder that filters low‑quality training samples, improving output coherence.
- Tool‑Use Masking – Masks non‑tool tokens during training to enforce strict schema adherence (JSON/YAML).
- DPO (Direct Preference Optimization) – Fine‑tunes on preference pairs to reduce hallucinations and improve helpfulness.
- Uncertainty Estimation – Monitors token‑level entropy and escalates to safe responses when confidence drops below a threshold.
- RAG (Retrieval‑Augmented Generation) – Retrieves relevant chunks from a local knowledge base (FAISS) to ground responses.
- Semantic Cache – Reuses previous generations for semantically similar queries, reducing latency and cost.
- Quantization & Pruning – Compress the model to 2‑8 bits and prune unimportant weights; backend support for AutoGPTQ, llama.cpp (GGUF), and bitsandbytes.
- KV‑Cache – Intelligent reuse of key/value states reduces inference latency by up to 78% (measured on local benchmarks).
- Soul.md Configuration – Define personality, sub‑agent rules, proactive tasks, and prompt injection defenses in plain Markdown.
- Export Ready – One‑click export to a Hugging Face Space (Docker‑based) or a portable ZIP archive.
- Quantized (4‑bit GGUF) – Optimized for memory‑constrained environments; runs smoothly on CPU.
🚀 How to Use
Option 1: Run with OpenClaw (Local)
- Install OpenClaw.
- Download this repository or place the files in your OpenClaw
agents/directory. - Configure the agent in
openclaw.toml:
toml
[agent.fallback]
path = "agents/microclaw"
port = 18789
Start OpenClaw – the fallback agent will listen on port 18789.
Option 2: Deploy to Hugging Face Space
Click the "Use this model" button on the Hugging Face Hub and select "Duplicate Space".
Choose a Docker‑based Space (the included Dockerfile is ready).
The Space will launch an API endpoint at https://your-space.hf.space.
Configure OpenClaw to use this endpoint as a remote fallback.
Below is a comprehensive, step‑by‑step guide to install all the key framework dependencies for OpenClaw (Docker, Node.js, TypeScript, SQLite, etc.) on Kali Linux and then integrate the Microclaw Fallback Agent from Hugging Face. The guide combines general dependency setup with the detailed Microclaw installation steps provided in the official repository.
📦 Install OpenClaw Core Dependencies
OpenClaw is a modern agent framework built with Node.js/TypeScript, Docker, SQLite, and configured via YAML/JSON/Markdown. Run these commands to set up the environment on a fresh Kali system.
1.1 System Update & Basic Tools
bash
sudo apt update
sudo apt upgrade -y
sudo apt install -y curl wget git build-essential
1.2 Install Docker (for containerized execution)
bash
# Add Docker's official GPG key and repository
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bullseye stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker Engine
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
# Add your user to the docker group (avoid sudo for every command)
sudo usermod -aG docker $USER
newgrp docker # activate group changes in current shell
1.3 Install Node.js (v18 or later) & TypeScript
bash
# Using NodeSource repository for a modern Node.js version
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs
# Install TypeScript globally
sudo npm install -g typescript
# Verify
node --version # should be v22.x or higher
tsc --version
1.4 Install SQLite (for memory & logs)
bash
sudo apt install -y sqlite3 libsqlite3-dev
1.5 (Optional) Install Yarn – often used in Node.js projects
bash
npm install --global yarn
🧠 Part 2: Install Microclaw Fallback Agent
The Microclaw agent is a Python‑based service (Flask + Transformers) that communicates with OpenClaw. You can install it using either a Python virtual environment (lightweight) or Conda (more reliable for PyTorch). Choose one method below.
2.1 Clone the Microclaw Repository
bash
Create a parent directory for all agents
sudo mkdir -p /opt/openclaw-agents
sudo chown -R $USER:$USER /opt/openclaw-agents
cd /opt/openclaw-agents
# Clone the Hugging Face repo (includes model files and soul configuration)
git lfs install
git clone https://huggingface.co/webxos/microclaw-for-openclaw-version-2026.2.17 microclaw-fallback
cd microclaw-fallback
Note: The .gguf model files are several hundred MB. If the download is interrupted, git lfs can resume. After cloning, verify the file sizes: bash
ls -lh *.gguf
They should be >100 MB, not 28 bytes. If they are still placeholders, run git lfs pull manually.
2.2 Option A: Install with Python Virtual Environment (venv)
bash
# Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate
# Upgrade pip and install dependencies
pip install --upgrade pip
pip install -r requirements.txt
If requirements.txt is missing, install core packages manually
pip install flask transformers torch sentence-transformers faiss-cpu --extra-index-url https://download.pytorch.org/whl/cpu
2.3 Option B: Install with Conda (Recommended for unstable networks)
bash
# Download and install Miniconda (if not already present)
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/miniconda3
source ~/miniconda3/bin/activate
# Create a dedicated environment with Python 3.11
conda create -y -n microclaw python=3.11
conda activate microclaw
# Install CPU‑only PyTorch from conda-forge (smaller, more reliable)
conda install -y pytorch torchvision torchaudio cpuonly -c pytorch
# Install the rest via pip
pip install flask transformers sentence-transformers faiss-cpu
2.4 Test the Agent Manually
bash
# Make sure you are in the agent directory with the environment activated
python main.py
You should see output like * Running on http://127.0.0.1:18789. Press Ctrl+C to stop it.
⚙️ Part 3: Configure OpenClaw to Use the Microclaw Fallback
OpenClaw reads its configuration from a TOML file (typically ~/.config/openclaw/config.toml or /etc/openclaw/config.toml). You need to point it to your local Microclaw instance.
Find the port Microclaw listens on (default is 18789, defined in main.py):
bash
grep port main.py
Edit the OpenClaw configuration (create it if it doesn't exist):
bash
mkdir -p ~/.config/openclaw
nano ~/.config/openclaw/config.toml
Add or modify the [agent.fallback] section:
toml
[agent.fallback]
path = "/opt/openclaw-agents/microclaw-fallback"
port = 18789
enabled = true
If OpenClaw is already installed, restart it. (If you haven't installed OpenClaw yet, see Part 4 below.)
🐳 Part 4: Install & Run OpenClaw (the main framework)
The OpenClaw core is a Node.js/TypeScript application. You can run it directly from source or use the provided Docker image.
4.1 Run OpenClaw via Docker (easiest)
bash
Pull the official OpenClaw image (adjust tag as needed)
docker pull openclaw/openclaw:latest
Run the container, mounting the config and agents directories
docker run -d \
--name openclaw \
-p 3000:3000 \
-v ~/.config/openclaw:/home/node/.config/openclaw \
-v /opt/openclaw-agents:/opt/openclaw-agents \
openclaw/openclaw:latest
4.2 Run OpenClaw from Source (for development) bash
Clone the OpenClaw repository
git clone https://github.com/openclaw/core.git openclaw-core
cd openclaw-core
Install dependencies
yarn install
Build TypeScript
yarn build
Start OpenClaw (it will read the config from ~/.config/openclaw/config.toml)
yarn start
🧪 Part 5: Verify the Integration
Check that Microclaw is running (either manually or via systemd):
bash
curl http://localhost:18789/health
Expected response: {"status":"ok"} or similar
Check OpenClaw logs to confirm it recognises the fallback agent: bash
docker logs openclaw # if using Docker
# or journalctl -u openclaw if installed natively
Simulate a primary agent failure (if possible) and observe that Microclaw handles fallback requests.
🔁 Optional: Make Microclaw Start Automatically (systemd)
To ensure the fallback agent starts on boot and restarts if it crashes, create a systemd service.
Create the service file: bash
sudo nano /etc/systemd/system/microclaw-fallback.service
Paste (adjust User and paths to match your setup):
ini
[Unit]
Description=Microclaw Fallback Agent for OpenClaw
After=network.target
[Service]
Type=simple
User=kali
WorkingDirectory=/opt/openclaw-agents/microclaw-fallback
Environment="PATH=/opt/openclaw-agents/microclaw-fallback/venv/bin"
ExecStart=/opt/openclaw-agents/microclaw-fallback/venv/bin/python /opt/openclaw-agents/microclaw-fallback/main.py
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
Enable and start:
bash
sudo systemctl daemon-reload
sudo systemctl enable microclaw-fallback.service
sudo systemctl start microclaw-fallback.service
Check status: sudo systemctl status microclaw-fallback.service
The webxos/microclaw-for-openclaw-version-2026.2.17 model is specifically provided in a quantized GGUF format. This means you can run it efficiently as a local API server without Conda or Python, using llama.cpp. This guide provides a streamlined, step‑by‑step workflow to do exactly that.
📦 Prerequisites: Essential System Tools
You need a few standard command-line tools. Open a terminal and run: bash
Update your package list and install curl, wget, git, and build tools
sudo apt update && sudo apt upgrade -y
sudo apt install -y curl wget git build-essential
📥 Step 1: Download the Model with Git LFS
The model files are hosted in a Git repository and require Git Large File Storage (LFS) to download the actual GGUF files. bash
1. Install Git LFS
sudo apt install -y git-lfs
git lfs install
2. Create a directory for your models and clone the repository
mkdir -p ~/models
cd ~/models
git clone https://huggingface.co/webxos/microclaw-for-openclaw-version-2026.2.17 microclaw-fallback
cd microclaw-fallback
3. Ensure the GGUF files are fully downloaded
git lfs pull
Verification: After cloning, check that the .gguf files are present and are a reasonable size (several hundred MB, not 28 bytes). Run:
bash
ls -lh *.gguf
If the files are small placeholders, run git lfs pull again.
⚙️ Step 2: Set Up the llama.cpp Server
Now, download, compile, and set up llama.cpp with its built-in server. bash
1. Clone the llama.cpp repository
cd ~/models
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
2. Compile llama.cpp (this may take a few minutes)
make -j4
3. (Optional but recommended) Install the Python dependencies for the server
This step requires Python/pip, but it's a one-time, isolated setup.
sudo apt install -y python3-pip python3-venv
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
🚀 Step 3: Run the Model Server
Now, start the server, pointing it to the GGUF model file you downloaded. bash
Make sure you are in the llama.cpp directory with the virtual env activated
cd ~/models/llama.cpp
source venv/bin/activate
Find the exact GGUF filename (replace with the actual filename you have)
MODEL_FILE=~/models/microclaw-fallback/microclaw-for-openclaw-version-2026.2.17.Q4_K_M.gguf
Run the server
./server -m $MODEL_FILE \
--host 0.0.0.0 \
--port 8000 \
-c 2048 \
-ngl 0 # Use -ngl 33 if you have an NVIDIA GPU and compiled with CUDA support
Explanation of flags:
-m $MODEL_FILE : Path to your GGUF model.
--host 0.0.0.0 : Listen on all network interfaces (so OpenClaw can connect).
--port 8000 : The port the server will use.
-c 2048 : Context size (adjust based on model requirements).
-ngl 0 : Number of layers to offload to GPU. Use -ngl 33 (or more) if you have an NVIDIA GPU and compiled with CUDA.
Keep this terminal window open. The server is now running and ready to accept requests.
✅ Step 4: Test the Server
Open a new terminal and test the API to ensure it's working correctly. bash
curl http://localhost:8000/v1/completions \
-H "Content-Type: application/json" \
-d '{
"prompt": "What is the capital of France?",
"max_tokens": 50,
"temperature": 0.7
}'
You should receive a JSON response containing the model's generated text.
🔌 Step 5: Configure OpenClaw to Use the Local Server
Now, configure OpenClaw to use this local server as its fallback agent.
Locate OpenClaw's configuration file. This is often ~/.config/openclaw/config.toml, /etc/openclaw/config.toml, or a .env file in the OpenClaw directory.
Edit the configuration to define a custom provider that points to your local server. The exact variable names depend on your OpenClaw version, but it generally looks something like this:
toml
[agent.fallback]
provider = "custom" # or "openai-compatible"
base_url = "http://localhost:8000/v1"
api_key = "not-needed" # llama.cpp server doesn't require a key
model = "microclaw" # Optional: model name
enabled = true
If OpenClaw uses environment variables (e.g., in a .env file), you might set: text
OPENCLAW_FALLBACK_PROVIDER=custom
OPENCLAW_CUSTOM_BASE_URL=http://localhost:8000/v1
OPENCLAW_CUSTOM_API_KEY=not-needed
Restart OpenClaw for the changes to take effect.
🔁 (Optional) Step 6: Run the Server as a Background Service
To have the server start automatically on boot and restart if it crashes, you can create a systemd service.
Create the service file: bash
sudo nano /etc/systemd/system/microclaw-llama.service
Paste the following (adjust User, WorkingDirectory, and ExecStart paths as needed):
ini
[Unit]
Description=llama.cpp server for Microclaw
After=network.target
[Service]
Type=simple
User=kali
WorkingDirectory=/home/kali/models/llama.cpp
ExecStart=/home/kali/models/llama.cpp/server -m /home/kali/models/microclaw-fallback/microclaw-for-openclaw-version-2026.2.17.Q4_K_M.gguf --host 0.0.0.0 --port 8000 -c 2048 -ngl 0
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
Then enable and start the service: bash
sudo systemctl daemon-reload
sudo systemctl enable microclaw-llama.service
sudo systemctl start microclaw-llama.service
sudo systemctl status microclaw-llama.service # Check if it's running
✅ Summary
🐛 Troubleshooting Tips
Model file not found: Ensure the path in the -m flag is correct. Use the absolute path.
Port already in use: Change the --port value (e.g., to 8001) and update your OpenClaw configuration.
Server starts but responds slowly: This is normal on CPU. You can try a smaller, more quantized GGUF variant from the Hugging Face repo (e.g., Q2_K for 2-bit).
If 'git lfs pull' fails or is slow: If downloads are interrupted, run the command again—it will resume.
OpenClaw cannot connect: Verify the server is running with curl (as in Step 4). Check any firewall rules. If OpenClaw is in a Docker container, ensure they are on the same network (using --network host for the OpenClaw container is the simplest solution).
You now have a fully functional local OpenClaw environment with:
Docker for sandboxed execution.
Node.js/TypeScript for the core runtime.
SQLite for memory storage.
Microclaw v2026.2.17 as a robust, offline‑capable fallback agent featuring tool masking, DPO, uncertainty estimation, RAG, and semantic caching.
📁 Customising the Agent (Soul Files)
The agent’s behaviour is fully defined by Markdown files in the soul/ directory. Edit them to match your needs:
SOUL.md – Core personality and instructions.
AGENTS.md – Rules for spawning sub‑agents (long‑running tasks).
HEARTBEAT.md – Proactive tasks executed on a schedule.
SECURITY.md – Defences against prompt injection.
LICENSE
Apache 2.0 License.
- Downloads last month
- -
We're not able to determine the quantization variants.
Model tree for webxos/microclaw-for-openclaw-version-2026.2.17
Base model
openai-community/gpt2