Skip to content

AI and LLM

František Bereň edited this page Sep 18, 2026 · 2 revisions

AI and LLM

One interface over fifteen LLM providers, plus agents that can use tools.

The providers

Birko.AI.Providers ships: Claude, OpenAI, Gemini, Azure OpenAI, Ollama, DeepSeek, Mistral, Groq, OpenRouter, GitHub Copilot, LM Studio, llama.cpp, vLLM, SGLang, Z.AI.

Anything OpenAI-compatible can reuse OpenAiCompatibleProviderBase, so a new endpoint is usually a small subclass rather than a new integration.

Calling a model

Providers are created through a factory, so the choice can come from configuration rather than code:

using Birko.AI.Factories;

var provider = LlmProviderFactory.Create("claude");   // name is case-insensitive

var response = await provider.SendMessageAsync(
    messages:     new List<Message> { new() { Role = "user", Content = "Summarise this." } },
    tools:        new List<Tool>(),
    systemPrompt: "You are concise.");

Streaming uses SendMessageStreamingAsync with the same arguments.

Registering your own

LlmProviderFactory.Register("my-provider", _ => new MyProvider());

if (LlmProviderFactory.IsRegistered("my-provider"))
    var p = LlmProviderFactory.Create("my-provider");

Implement ILlmProvider — Name, SendMessageAsync, SendMessageStreamingAsync. That is the whole contract, and it is what makes a stub provider easy in tests.

Agents

Birko.AI.Agents builds on providers: an agent has a system prompt, a tool set, and a loop.

Agent Does
CodingAgent reads and edits code
DiagrammingAgent produces diagrams
MediaAgent image and media work
OrchestratorAgent plans and delegates to other agents

Birko.AI.Orchestration adds task dispatch, implementation plans and dependency analysis between steps — for when one prompt is not enough.

Keeping it from costing too much

Birko.AI.Resilience wraps any provider:

  • rate limiting per provider
  • circuit breaker — stop hammering a failing endpoint
  • cost tracking — CostTrackingService and TrackedLlmProvider record spend per call
var tracked = new TrackedLlmProvider(inner, costTracker);

Worth wiring before you put an LLM in a loop.

Layout

Birko.AI.Contracts      ILlmProvider, Message, Tool, AgentOptions — zero dependencies
  └─ Birko.AI           provider base, agent base, default tools
      ├─ .Providers     the fifteen
      ├─ .Agents        the agents above
      ├─ .Orchestration multi-step planning
      └─ .Resilience    rate limit, circuit breaker, cost

Depend on Birko.AI.Contracts alone if you only need to accept an ILlmProvider — it pulls nothing else in.

Next

Clone this wiki locally