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 SDK

Policy-driven execution infrastructure for agent systems

Kernell OS SDK is not a simple LLM wrapper.
It is an execution control plane that optimizes inference cost, quality, and latency while collecting feedback to improve routing decisions over time.

What This SDK Is

  • Policy-driven inference engine
  • Multi-tier execution router (local, cheap API, premium API)
  • Quality-aware runtime with verification and safe fallback
  • Telemetry + labeling + training pipeline for continuous improvement
  • Agent runtime foundation (security, sandboxing, economics, marketplace, governance)

What This SDK Is Not

  • Prompt utility library
  • Single-model client wrapper
  • Static rule router without learning loop

Core Value Proposition

Traditional flow:

input -> one LLM

Kernell OS flow:

input -> policy decision -> multi-layer execution -> verification -> telemetry -> retraining

Why this matters

  • Optimize costs without blindly degrading quality
  • Route dynamically per task/hardware/risk
  • Learn from production behavior (data flywheel)
  • Keep fallback safety under uncertainty

Architecture Overview

Task Input
  -> Policy Model (Lite/Pro)
  -> (Optional) Task Decomposition
  -> Execution Layers:
       [Semantic Cache] -> [Local] -> [Cheap API] -> [Premium]
  -> Self Verification
  -> Re-route / Fallback (if needed)
  -> Telemetry
  -> Offline Labeling
  -> Dataset / Fine-tuning Pipeline

Routing Strategy

The router is policy-driven, not difficulty-only:

  • route: local | cheap | premium | hybrid
  • confidence
  • risk
  • expected_cost_usd
  • expected_latency_s
  • needs_decomposition

When confidence/risk/economic uncertainty is unsafe, it forces hybrid fallback path.


Main Components (Real Modules)

Router and Policy

  • kernell_os_sdk/router/intelligent_router.py
    Orchestrates execution across cache/local/cheap/premium, verification, telemetry.
  • kernell_os_sdk/router/policy_lite.py
    Local policy model client with safety overrides.
  • kernell_os_sdk/router/classifier_pro.py
    Cloud escalation client for higher-precision routing.
  • kernell_os_sdk/router/types.py
    Canonical contracts (PolicyDecision, tiers, results).
  • kernell_os_sdk/router/entrypoint.py
    Shadow/canary/full rollout entrypoint with safe fallback.

Quality, Cost, and Context

  • kernell_os_sdk/router/verifier.py (SelfVerifier)
  • kernell_os_sdk/router/estimator.py (CostEstimator)
  • kernell_os_sdk/router/summarizer.py (RollingSummarizer)
  • kernell_os_sdk/router/decomposer.py (TaskDecomposer)
  • kernell_os_sdk/router/model_registry.py (ModelRegistry)

Telemetry and Learning Loop

  • kernell_os_sdk/router/telemetry_collector.py
    Collects anonymized route/outcome/quality signals.
  • kernell_os_sdk/router/offline_labeler.py
    Produces optimal-route labels from real outcomes (cost + quality aware).

Data Pipeline Scripts

  • scripts/policy_build_dataset.py -> telemetry to labeled dataset
  • scripts/policy_make_sft_jsonl.py -> labeled dataset to SFT JSONL
  • scripts/policy_train_lora.py -> LoRA training scaffold
  • scripts/policy_audit_dataset.py -> distribution and sampling audit

Runtime, Security, and Infra Domains

  • kernell_os_sdk/runtime/
    Firecracker/Docker/Subprocess/hybrid runtime primitives
  • kernell_os_sdk/security/
    policy, verifier, SSRF and capability controls
  • kernell_os_sdk/cognitive/
    memory graph, execution graph, semantic modules
  • kernell_os_sdk/marketplace/, governance/, cluster/, delegation/, escrow/
    economic coordination and distributed agent primitives

Data Flywheel

Kernell OS improves routing through a closed learning loop:

  1. Runtime emits telemetry from real executions
  2. Offline labeler computes optimal route targets
  3. Dataset is generated and audited
  4. Model fine-tuning is prepared/executed
  5. Updated policy models are deployed

This converts routing mistakes into training signal (underestimation, overestimation, misroute) and enables continuous optimization.


Safety and Production Hardening

  • Verification-aware routing to reduce low-quality escalations
  • Risk-aware and budget-aware fallback to hybrid
  • Optional Prometheus dependency (non-blocking no-op fallback in runtime metrics)
  • Shadow/canary rollout strategy before full traffic cutover
  • Rate limiting, sandbox controls, and capability policy modules available in SDK

Installation

pip install kernell-os

Optional observability dependency:

pip install prometheus_client

Minimal Example

from kernell_os_sdk.router import PolicyLiteClient, PolicyLiteConfig

# Integrate PolicyLiteClient into your IntelligentRouter wiring
# based on your local model backend and runtime configuration.

See kernell_os_sdk/router/ modules and tests for concrete integration patterns.


Testing

Router and flywheel suites:

python -m pytest tests/test_router.py tests/test_data_flywheel.py tests/test_policy_lite.py -q

Current Status

Implemented now

  • Policy-driven router integration
  • Telemetry v2 with policy signals
  • Offline labeling pipeline with quality-aware guards
  • Dataset audit tooling and sampling workflow
  • Regression-tested router/flywheel suites

Planned / in progress

  • Persistent semantic cache backend integration (distributed)
  • Full training automation and model promotion gates
  • Expanded online feedback correction and deploy gating benchmarks

Open-Core Positioning

  • SDK core: open source runtime and routing foundations
  • Advanced policy intelligence and cloud services: source-available/commercial layers

From static LLM calls to adaptive inference infrastructure.

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.2.0b0.tar.gz (4.5 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.2.0b0-py3-none-any.whl (3.7 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kernell_os-2.2.0b0.tar.gz
  • Upload date:
  • Size: 4.5 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.2.0b0.tar.gz
Algorithm Hash digest
SHA256 84b6a923c6a9fd5d2e12063e15086ebcf72a0e05e676404666dd43f20947ac7f
MD5 07e91c6ab05457ab928ba215ebbba22a
BLAKE2b-256 e389551201ccdbb36a4030b14f13f6b5b1a2f89651924196fc9dfc93e2044484

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kernell_os-2.2.0b0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 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.2.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 82342eca91d33f47b4b8446d11d6fa55aea5000a98f64a2a710b1b37ecfb8052
MD5 620b697ba36e323f0c9e2ca682d31c27
BLAKE2b-256 fa9333be930318c1b71c81b1509edcaf86a935b5503cffbf5e7b7f07bf847c39

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