Open Source · Apache 2.0

Small Models.
Big Impact.

An agent framework purpose-built for 1-7B parameter models. Template-based structured output, automatic JSON repair, and workflow visualization — all from a few lines of Python.

Python 3.9+Fork of Agno v2.5Apache 2.0 License
43+Model Providers

Native support for local and API-based models

125+Built-In Tools

Calculators, python execution, web search & MCP

18Vector Backends

Robust vector DB integrations for memory & RAG

10/10Benchmark Score

Flawless structured output accuracy tests

0Malformed JSONs

Automatic repair and recovery handles corrupt outputs

Apache 2.0Open Source

Permissive license ready for enterprise use

The Problem

Small models are cheap.
But they break.

Running 1-7B parameter models cuts your inference cost by 10-50×. But smaller models produce malformed JSON, miss schema fields, and hallucinate structures that crash your pipeline.

Structured Output Failures
0%

of 3B model responses fail JSON schema validation on first attempt — missing fields, wrong types, malformed syntax.

Typical Failure Modes
Cost Per 1M Tokens
GPT-4o$5.00
Llama 3B (local)$0.00
Mistral 7B (hosted)$0.10

50× cheaper — if you can make them reliable.

The savings are real. The reliability gap is the only thing standing between you and production-grade small model workflows. Kern closes that gap.

Features

Everything you need for small model agents

Production-ready features optimized for models that run on consumer hardware — not 200B parameter clusters.

Template-Based Structured Output

Fill-in-the-blank templates instead of JSON Schema. Purpose-built so small models actually produce valid structured data.

Automatic JSON Repair

Built-in repair with LaTeX protection. Handles malformed output, leading text, and escape corruption — automatically.

Workflow Engine

Build complex multi-step agent pipelines with Step, Condition, Router, Loop, and Parallel execution patterns.

Workflow Visualization

Generate Mermaid flowcharts from your workflows. Export as SVG, PNG, or display interactively with three color themes.

Rich Tool Ecosystem

DuckDuckGo search, Calculator, Python execution, MCP tools, and more. Build custom tools with simple decorators.

Multi-Model Support

OpenAI, Anthropic, Google, Ollama, Groq — or any OpenAI-compatible endpoint. Run local or in the cloud.

Storage & Knowledge

Postgres, SQLite, Redis, MongoDB backends. Knowledge bases with pgvector, Chroma, LanceDB, and Qdrant.

Agent Teams

Coordinate multiple agents. Route tasks, share context, and build complex multi-agent systems with teams.

Examples

See it in action

From structured output to workflow visualization — Kern handles the hard parts.

structured_output.pypython
1from kern import Agent
2from kern.models.openai import OpenAIChat
3from pydantic import BaseModel, Field
4
5class MovieReview(BaseModel):
6 title: str = Field(description="Movie title")
7 rating: int = Field(description="Rating 1-10")
8 summary: str = Field(description="Brief review")
9
10agent = Agent(
11 model=OpenAIChat(id="gpt-4o-mini"),
12 output_schema=MovieReview,
13)
14
15result = agent.run("Review The Matrix")
16# Works reliably even with 2B parameter models!
17
18print(result.content)
19# {
20# "title": "The Matrix",
21# "rating": 9,
22# "summary": "A groundbreaking sci-fi film..."
23# }

Comparison

Why Kern?

Built on Agno with critical optimizations for models that run on consumer hardware.

FeatureKernAgnoLangChain
Structured output for <7B models
Automatic JSON repair
Template-based output (no JSON Schema)
LaTeX protection in JSON
Workflow engine
Workflow visualization
Multi-model support
Agent teams
Tool ecosystem
Knowledge bases + Vector DB
Lightweight / minimal deps
Optimized for local models
Coming Soon

End-to-End Agent Infrastructure

Fully managed agent infrastructure — deployment, monitoring, scaling, and observability for agents powered by small models. Join the waitlist to be first in line.

Hosted agent deployment·Real-time monitoring·Auto-scaling·Small model optimization