OpenSquilla - an open-source microkernel AI agent framework that reduces token costs.
OpenSquilla is an open-source, self-hosted, token-based, high-efficiency microkernel AI agent runtime that emphasizes 'higher intelligence density for the same budget'. It employs a minimalist microkernel architecture (the core has only about 100 lines of code) and utilizes local ML...
What is OpenSquilla?
OpenSquilla is an open-source, self-hosted, token-efficient microkernel AI agent runtime that emphasizes "higher intelligence density for the same budget." Employing a minimalist microkernel architecture (with a core of only about 100 lines of code), it reduces token costs by 60-80% through local ML model routing, adaptive inference depth, a four-layer cognitive memory system, and on-demand skill loading. It supports over 20 mainstream LLM providers, including OpenAI, Anthropic, DeepSeek, and Gemini, and features a built-in layered security sandbox, a multi-channel unified gateway (Web/Slack/Lark/DingTalk, etc.), and a rich toolset. It also provides migration tools from OpenClaw and Hermes Agent.
Main functions of OpenSquilla
-
SquillaRouter Smart RouterThe local LightGBM + ONNX classifier integrates message length, language, code block, keyword and semantic embedding scores to automatically route tasks to the cheapest available models at four levels (T0-T3). The classification process is completed entirely on the device.
-
Adaptive inference depthDeep inference is enabled only for complex queries; simple questions do not consume inference tokens. The system prompt is automatically scaled according to the complexity of the task to avoid excessive consumption.
-
Unified access for multiple LLM providersSupports 20+ providers including OpenRouter, OpenAI, Anthropic, Ollama, DeepSeek, Gemini, Qwen/DashScope, Moonshot, Mistral, and Groq, and supports automatic switching between primary and backup models.
-
Four-layer cognitive memory architectureWorking memory, episodic memory, semantic memory, primitive memory, support vector semantic retrieval (sqlite-vec) + BM25 keyword search + automatic memory decay and "bubble" promotion + dream mode (automatically condenses new skill candidates during idle time).
-
MetaSkills composable workflowsSupports composable workflow orchestration, self-service creation via meta-skill-creator, automatic retrieval of 10+ built-in and N+ community skills, and supports replay playback and self-evolution in Dream mode.
-
Layered safety sandboxIt offers three isolation levels: Standard, Strict, and Locked. Under Linux, it uses Bubblewrap for system call-level isolation (CPU/memory/duration/network), and can be deployed to a serverless environment without Docker.
-
Unified gateway and multi-channel access: Local gateway based on Starlette ASGI (default)
127.0.0.1:18791Web UI, CLI, Slack, Discord, Telegram, Lark, DingTalk, WeChat Work, QQ, Matrix, etc. share the same TurnRunner loop. -
Rich built-in toolsetFeatures include: file reading, writing, and editing; shell and background processes; Git; web search (Brave/DuckDuckGo); SSRF protection; PPT/Word/Excel/PDF generation; image generation; TTS, etc.
-
Cost tracking and quota managementThe token and fee are summarized for each round/session, and the built-in quota hook can automatically save money and prevent overspending, achieving refined cost control.
-
Microkernel plug-in architectureThe core orchestrator has only about 100 lines of code and is responsible for state machine and pipeline orchestration. All capabilities (Provider, Memory, Channels, Tools, Sandbox, etc.) run as plugins in "user space" and plugin crashes do not affect the core.
Follow us on WeChat and reply with "open source",join inAI open source project discussion group
How to use OpenSquilla
-
Environmental preparation and installationEnsure your system has Python 3.12 or later installed.
uvThe tool allows for one-click installation of OpenSquilla (current version 0.3.1), supporting all platforms including Windows, macOS, and Linux. -
Initialization configuration:run
opensquilla onboardComplete the initial boot configuration, including setting the default LLM provider, API Key, memory storage path, and security sandbox policy (Standard/Strict/Locked). -
Start the local gateway:implement
opensquilla gateway runStart the unified gateway based on Starlette ASGI, which will listen to the default settings.127.0.0.1:18791Browser accesshttp://127.0.0.1:18791/control/Access the Web console. -
Configure multiple LLM providersAdd API keys from 20+ providers, including OpenAI, Anthropic, DeepSeek, Gemini, Qwen, and Moonshot, to the console or configuration file, set the primary and backup models, and enable SquillaRouter for automatic routing.
-
Interact via Web UIYou can directly input tasks in the console, and the system will automatically complete model routing, inference depth judgment, memory retrieval, and tool calls, and view the token consumption and cost of each round in real time.
-
Access to multi-channel platformConfigure Webhooks or Bot Tokens for channels such as Slack, Discord, Telegram, Lark, DingTalk, WeChat Work, QQ, and Matrix to enable the sharing of the same Agent across multiple platforms.
-
Using and Creating MetaSkills: Use built-in Skills to handle common tasks, or via
meta-skill-creatorSelf-service creation allows for the combination of workflows; enabling Dream mode allows the system to automatically generate new skill candidates when idle. -
Managing memory and contextThe system automatically maintains a four-layer architecture of working memory, contextual memory, semantic memory, and primitive memory; it supports manual viewing and editing of memory entries and configuration of automatic decay and bubble promotion strategies.
-
Configure security sandboxEnable Bubblewrap system call level isolation in Linux environments to limit CPU, memory, execution time, and network access, allowing secure execution of shell and file operations without Docker.
-
Monitoring and Quota ManagementView the token and fee summary for each round/session in the console, set quota thresholds to automatically reduce spending and prevent budget overruns.
-
Data migration (optional)If migrating from OpenClaw or Hermes Agent, use the official migration tool to import memories, personality files, skills, and channel configurations, preview and resolve conflicts.
OpenSquilla's official website address
- Project official website: https://opensquilla.ai/zh/ or https://opensquilla.ai/
- GitHub repositoryhttps://github.com/opensquilla/opensquilla
OpenSquilla's core advantages
-
Token costs reduced by 60-80%Achieve higher intelligence density on the same budget through local ML intelligent routing, adaptive inference depth, Prompt autoscaling, and on-demand skill loading.
-
Minimalist microkernel architectureThe core orchestrator has only about 100 lines of code, and all capabilities run in user space as plugins. A single plugin crash does not affect the core, and core upgrades do not break plugins.
-
Local intelligent model routingSquillaRouter uses the LightGBM+ONNX classifier to perform scoring locally on the device, automatically assigning tasks to the cheapest available models in four levels (T0-T3) with zero cloud routing overhead.
-
Four-layer cognitive memory systemIt features hierarchical management of working memory, episodic memory, semantic memory, and primitive memory, supports vector retrieval, BM25 keyword search, automatic decay, and "bubbling" promotion, making memory more accurate the more it is used.
-
Adaptive reasoning and PromptDeep inference is enabled only for complex queries; simple queries consume zero inference tokens. The system prompt automatically scales based on task complexity to avoid excessive calls.
-
System-level security sandboxBubblewrap is used on Linux to achieve system call-level isolation for CPU, memory, duration, and network, allowing for secure deployment to a serverless environment without the need for Docker.
-
Multi-channel unified gatewayBased on Starlette ASGI, the local gateway allows Web UI, CLI, Slack, Discord, Telegram, Lark, DingTalk, WeChat Work, and other applications to share the same TurnRunner loop, enabling one-time deployment for full platform coverage.
-
MetaSkills Self-EvolutionIt supports combinatorial workflows, self-service creation, and automatic community retrieval. Combined with the dream mode, it automatically condenses new skill candidates during idle time, enabling the continuous evolution of Agent capabilities.
Comparison of OpenSquilla with similar products
| Dimension | OpenSquilla | OpenClaw | Hermes Agent |
|---|---|---|---|
| Architecture | Microkernel, 5-layer separation, minimalist core, automatic plugin skipping and rollback. | The plugin ecosystem is mature, but it has too many layers. | Single-entity synchronous main loop, logically tightly coupled |
| Cost optimization | ML routing + inference hierarchy + prompt caching + on-demand skills, saving 60-80% | The primary/secondary model chain is hardcoded in the configuration file, so it will not be selected automatically. | Based solely on keywords and word count for rough judgment, single route |
| MetaSkills | Combinable workflows + self-service creation + community-based automatic search + dream evolution | A skill chain linked by Prompt, without a meta-protocol layer. | No reusable workflow abstraction, rewritten from scratch each time. |
| Memory system | Vector + Keyword + Deduplication + Decay + Bubble Sort + Automatic Transfer | It has decay/bubbling/diversity rearrangement, but lacks a four-layer cognitive structure. | Keyword search only; semantic memory requires an external plugin. |
| Safety Sandbox | System call level isolation, no Docker required, suitable for serverless environments. | Docker is an option; OpenShell is lighter but still heavy. | Dangerous command approval + 6 execution environments |
| Cost tracking | Actual cost per call + automatic quota throttling | Built-in pricing table; costs are written to session metadata. | Input/output/caching/inference tokens are tracked separately. |
Application scenarios of OpenSquilla
-
Low-cost AI assistant for individuals and developersSquillaRouter reduces token costs by 60-80% with its intelligent routing and adaptive inference, making it suitable for individual developers, independent creators, or students with limited budgets as an AI assistant for daily programming, writing, and question answering.
-
Enterprise multi-platform intelligent customer service and office assistantIt can simultaneously access multiple channels such as Lark, DingTalk, WeChat Work, Slack, and Discord through a unified gateway. A single agent capability covers the entire company's communication platform, automatically handling internal inquiries, work order transfers, and Q&A.
-
Private AI Deployment in Highly Sensitive Data ScenariosIt supports fully self-hosted and local operation, with four layers of memory data stored locally. Combined with the Bubblewrap system-level security sandbox, it is suitable for industries with extremely high requirements for data privacy and compliance, such as finance, healthcare, and law.
-
Automated workflows and task orchestrationMetaSkills allows you to combine workflows and built-in toolsets (file editing, Git, web search, document generation) to automate repetitive tasks such as report generation, code review, data scraping, and batch processing of PPT/Excel files.
-
Multi-model strategy management and A/B testingIt can simultaneously connect to 20+ LLM providers and configure primary and backup models. Enterprises can dynamically allocate model resources according to task complexity, and it can also be used for performance comparison and cost optimization experiments between different models.
-
Serverless and edge computing deploymentThe microkernel architecture is lightweight and the secure sandbox can run without Docker, making it suitable for deployment on serverless function computing or edge devices as a low-resource-consumption embedded AI service.