Skip to main content

First public release of an agentic runtime for M2M coordination. Machines coordinate, verify, and settle value autonomously.

Project description

Kernell OS Logo

Kernell OS

Machines coordinate, verify, and settle value autonomously.


Kernell OS Demo


Tests Coverage Python License

Kernell OS is an agentic runtime where multiple AI systems collaborate, reuse accumulated knowledge, and transact value securely.

This is not another framework for LLM wrappers. This is infrastructure for autonomous machine-to-machine economies.


The Landscape

System Generates Code Remembers Architecture Coordinates Agents Settles M2M Value Optimizes Costs
Copilots
Agent Frameworks ⚠️ ⚠️
Kernell OS

How It Works

Kernell OS fundamentally shifts how LLMs interact with code, infrastructure, and economics:

  1. 3-Layer Token Economy Engine: Routes every task through the cheapest capable layer — Local (free) → Cheap API ($0.14/M) → Premium API (last resort). Achieves 85-95% cost reduction compared to sending everything to premium models.
  2. 🧠 Semantic Memory Graph: Doesn't cache strings. It learns and traverses architectural paths, reusing proven dependencies and pruning toxic routes via the Dual Confidence Model.
  3. 🛡️ Intent Firewall: Untrusted AI execution is halted. Every action (syscalls, file writes, outbound requests) is sandbox-verified before touching the host system.
  4. 💰 Escrow Engine: Agents are financially bound. Kernell holds execution value in cryptographic escrow, releasing funds ($KERN) only upon verified, monotonic success.
  5. 📊 Production Observability: Prometheus-ready metrics, cost-per-task tracking, misclassification detection, and pre-execution cost simulation — all exposed via dashboard and API.

Token Economy Engine (NEW)

The Intelligent Router is the economic brain of Kernell OS. It eliminates unnecessary API spend by routing tasks through a 3-layer pipeline:

INPUT → Decompose → Cache Check → Local Exec → Verify → [Cheap API] → [Premium API]
                                                  ↑                         ↑
                                           AutoMix Gate              Last resort only

Architecture

Layer Models Cost/1M tokens When Used
Local (Ollama) Qwen3-1.7B, Gemma3-4B, Mistral-7B, DeepSeek-R1-14B $0.00 Default for 70%+ of tasks
Cheap API DeepSeek V3, Groq, Gemini Flash $0.14 - $0.55 Medium-complexity tasks
Premium API Claude Opus, GPT-5, Gemini Pro $15 - $75 Expert-level only

Anti-Waste Components

  • SemanticCache: Skip repeated work entirely (40-70% fewer API calls)
  • RollingSummarizer: Compress context between steps (kills O(n²) token leak)
  • SelfVerifier: Validate output before escalating (prevents premature spend)
  • CostEstimator: Show cost before execution — full transparency

Deployment Strategy

The router integrates via safe dual-mode — no breaking changes:

# Phase 0: Shadow Mode (default) — zero risk
#   Runs both routers, returns legacy, logs differences
config = RouterConfig(enable_intelligent_router=True, shadow_mode=True)

# Phase 1: Canary — 10% traffic to new router
config = RouterConfig(canary_percent=0.10)

# Phase 2: Full rollout with automatic fallback
config = RouterConfig(enable_intelligent_router=True)

Dashboard

The Command Center now includes a Token Economy panel:

  • 💰 Real-time cost vs. savings metrics
  • 🤖 Local model inventory (auto-detected from hardware)
  • ⚡ Inference provider key management
  • 📊 Prometheus /metrics endpoint for Grafana
  • 🎯 Classifier health + fine-tuning readiness score

Security

Production-grade security hardened with 98 automated tests:

  • 🔒 Sandbox Isolation: Docker/gVisor with AST-validated code execution
  • 🛡️ SSRF Protection: Centralized safe HTTP client, CIDR block enforcement
  • Rate Limiting: Sliding window with circuit breakers (Netflix Hystrix pattern)
  • 🔐 Cryptographic Passports: Ed25519 + AES-256-GCM agent identity
  • 📜 Audit Trail: Immutable operation log with redacted PII

Quickstart

# 1. Install the runtime
pip install kernell-os

# 2. Scaffold a new environment
kernell init

# 3. Boot the execution engine, Memory Graph, and Gateway
kernell start

# 4. Run the 60-second interactive demo
kernell demo

SDK Architecture (19,000+ LOC)

kernell_os_sdk/
├── router/          ⚡ 3-Layer Token Economy Engine (2,436 LOC)
├── cognitive/       🧠 Memory, Execution Graph, Intent Firewall
├── security/        🔒 Sandbox, SSRF, Rate Limiter, Policy Engine
├── escrow/          💰 Cryptographic Escrow Manager
├── llm/             🤖 Multi-provider LLM abstraction
├── cluster/         🌐 P2P Discovery + Compute Pool
├── governance/      🏛️ Agent DAOs + Federation
├── marketplace/     🏪 Matching Engine
├── delegation/      👥 Sub-agent Spawning
├── runtime/         📦 Docker/Firecracker/Subprocess isolation
└── dashboard.py     📊 FastAPI Command Center

Business Model (Open-Core)

Layer License Description
SDK Core ✅ Open Source Router, interfaces, integrations, base classifier
Classifier Pro 🔒 API Fine-tuned model with real-world optimization data
Cloud Platform 🔒 SaaS Managed router, dashboard, auto-learning pipeline


This is not a copilot.
This is infrastructure for autonomous systems.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kernell_os-2.0.3b0.tar.gz (4.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kernell_os-2.0.3b0-py3-none-any.whl (3.6 MB view details)

Uploaded Python 3

File details

Details for the file kernell_os-2.0.3b0.tar.gz.

File metadata

  • Download URL: kernell_os-2.0.3b0.tar.gz
  • Upload date:
  • Size: 4.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for kernell_os-2.0.3b0.tar.gz
Algorithm Hash digest
SHA256 f6e7bb6adcf69aaf752bb2f74287a9a807d2b1e7d137135ac8db2024b6f560d4
MD5 39d174f813415aae2e3f97609c045fd1
BLAKE2b-256 7e68d2baeea9e11205f5975012364d5b8170235d5ec9b273e40daf99401cf5db

See more details on using hashes here.

File details

Details for the file kernell_os-2.0.3b0-py3-none-any.whl.

File metadata

  • Download URL: kernell_os-2.0.3b0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for kernell_os-2.0.3b0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae2b772b57b6299ed24af2b9b1c4329a70cb9be21fe1c2c479e0b428e266d02e
MD5 7cc3f17245449a7c30b7b991cdadb4d8
BLAKE2b-256 b7251f829a3753807cda7e565fc57797156a1b9c42b91488cd817e15074ba02c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page