Klin
Klin autonomously optimizes the model inside an existing AI agent without changing the surrounding system.
Inspiration
Most AI agents depend on expensive frontier models, even when they perform the same narrow workflow repeatedly.
The difficult part is not finding a smaller model. It is replacing the model without breaking the agent—its tool calls, structured outputs, permissions, context handling, or downstream behavior.
We built Klin to turn that risky manual process into an autonomous and measurable research workflow.
What It Does
Klin connects to an existing agent, reconstructs its behavioral contract, and freezes everything around the model:
- Tools and permissions
- Inputs and outputs
- Business logic
- Context construction
- External behavior
It benchmarks the current frontier model, evaluates smaller local models, and autonomously explores supervised fine-tuning, LoRA, distillation, synthetic data, constrained generation, and runtime optimization.
The replacement target is:
$$ Q_{\text{local}} \geq Q_{\text{frontier}} - \epsilon $$
while requiring zero critical failures such as unauthorized actions, fabricated tool results, or malformed tool calls.
How We Built It
Klin combines a deterministic orchestration layer with an adaptive research loop.
It generates competing hypotheses, runs the cheapest decisive experiments, evaluates each candidate against frozen tests, rejects regressions, and creates new hypotheses when results reveal a different failure mechanism.
A live workspace displays active research branches, experiment progress, model artifacts, costs, estimated completion times, failed approaches, and the current best candidate.
Sponsor Integrations
- Zero.xyz provides new research capabilities when Klin encounters missing technical knowledge, datasets, documentation, or data-processing needs.
- Akash runs isolated model evaluation, fine-tuning, quantization, and stress-testing experiments.
- Pomerium protects agent tools and hidden evaluation data, ensuring candidates can access only approved resources.
Challenges and Lessons
The hardest challenge was creating a trustworthy comparison. A model can sound intelligent while selecting the wrong tool, generating invalid arguments, or fabricating a result.
We learned that optimizing an AI agent is not simply a fine-tuning problem. It is a systems-research problem involving the model, tools, runtime, permissions, evaluation, and application around it.
Klin turns model replacement into an autonomous engineering process—and builds a model specifically for the agent, rather than rebuilding the agent around the model.
Built With
- akash
- bonsai-27b
- docker
- gguf
- github
- huggingface
- llama.cpp
- lora
- mcp
- network
- openai
- pomerium
- python
- sqlite
- typescript
- zero.xyz
Log in or sign up for Devpost to join the conversation.