Krebs  by canwhite

Self-hosted AI gateway for versatile agentic applications

Created 5 months ago
651 stars

Top 50.5% on SourcePulse

GitHubView on GitHub
Project Summary

Krebs is a self-hosted AI gateway built around a general-purpose agent, designed to provide AI assistance for any task, not just coding. It offers stateful, multi-turn dialogue, intelligent context compression to manage token limits, and a flexible integration layer via a real-time browser UI and robust HTTP/WebSocket APIs. This makes it a powerful solution for users seeking a customizable, private, and deeply integrated AI assistant.

How It Works

The system's core is a stateful AI agent that facilitates multi-turn conversations and executes tools. A key innovation is its multi-layered context compression strategy, employing techniques like "Micro Compact" (pruning tool outputs), "Context Collapse" (summarizing dialogue), and "Auto Compact" (aggressive compression near limits) to efficiently manage token usage. Krebs exposes a user-friendly, real-time browser interface and a comprehensive HTTP/WebSocket API for seamless integration into CI/CD pipelines, scripts, and applications. Its architecture supports dynamic tool invocation, allowing immediate use of custom Lua scripts placed in lua-tools/ and leveraging 7 built-in skills.

Quick Start & Requirements

  • Install: Execute bun install within the project directory.
  • Run: Start the server with bun run server/index.ts.
  • Prerequisites: Requires the Bun runtime. API keys for LLM providers (e.g., DEEPSEEK_API_KEY recommended, ANTHROPIC_API_KEY alternative) must be set as environment variables.
  • Access: The web UI and API are accessible at http://localhost:3333.
  • Configuration: Key environment variables include PORT, MODEL_PROVIDER, MODEL_BASE_URL, and MODEL_ID.

Highlighted Details

  • General-Purpose Agent: Features stateful AI with multi-turn dialogue, tool execution, and skill invocation for broad applicability.
  • Context Compression: Implements three layers (Micro Compact, Context Collapse, Auto Compact) to intelligently manage and reduce token usage, extending conversation length.
  • Dual Interface: Offers both a real-time browser UI with Markdown rendering and a programmatic HTTP/WebSocket API for integrations.
  • Extensible Tooling: Supports custom Lua scripts dropped into lua-tools/ for immediate agent use, alongside 7 built-in skills.
  • Multi-Model Support: Configurable to switch between LLM providers like DeepSeek and Anthropic via environment variables.
  • Persistent Sessions: Conversations are saved, allowing users to resume past interactions by sessionId.

Maintenance & Community

No specific details on maintainers, community channels, sponsorships, or roadmap were provided in the README.

Licensing & Compatibility

The README does not specify the project's license or provide compatibility notes for commercial use or linking with closed-source projects.

Limitations & Caveats

The provided README does not detail any known limitations, alpha/beta status, unsupported platforms, or specific caveats regarding bugs or feature completeness.

Health Check
Last Commit

6 days ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
709 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.