llm

package
v0.1.0-beta.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package llm hosts the gridctl LLM provider abstraction. Each subpackage (anthropic, openai, google, gateway) implements the agent.ChatModel interface against a single vendor's wire format.

Providers use only net/http and encoding/json; gridctl deliberately avoids each vendor's official SDK because the LLM-API surface is narrow, the cost of impedance mismatches with our typed graph runtime is high, and the SDK ecosystems churn quickly. The provider tool adapters in <provider>/tools.go translate gridctl's agent.ToolInfo / agent.ToolCall to the vendor's tool format — the compose graph never sees vendor-specific shapes.

All providers honor the Article VI contract (ctx context.Context as first argument), the Article XIV contract (log/slog only — no fmt.Println / log.Printf), and the Article V contract (error propagation, no panics in library code).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider = agent.ChatModel

Provider is an alias for agent.ChatModel that carries the "Provider" terminology used throughout the prompt and architectural docs. Existing callers that already depend on agent.ChatModel continue to work unchanged; new code should prefer llm.Provider for consistency.

Directories

Path Synopsis
Package anthropic implements agent.ChatModel against the Anthropic Messages API.
Package anthropic implements agent.ChatModel against the Anthropic Messages API.
Package gateway is the LLM-side passthrough provider.
Package gateway is the LLM-side passthrough provider.
Package google implements agent.ChatModel against the Google Gemini Generative Language API.
Package google implements agent.ChatModel against the Google Gemini Generative Language API.
Package observed wraps an agent.ChatModel with the gridctl observability surface — OTel spans, pricing.CalculateBreakdown for USD cost, and metrics.Accumulator.RecordCost with a synthetic provider name (no MCP envelope spoofing).
Package observed wraps an agent.ChatModel with the gridctl observability surface — OTel spans, pricing.CalculateBreakdown for USD cost, and metrics.Accumulator.RecordCost with a synthetic provider name (no MCP envelope spoofing).
Package openai implements agent.ChatModel against the OpenAI Chat Completions API.
Package openai implements agent.ChatModel against the OpenAI Chat Completions API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL