Overview
llm-go is a provider-neutral Go library for model generation, streaming, tool use, multimodal messages, reasoning, and usage accounting. It keeps provider SDK types behind a small common API so applications can switch protocols without changing their conversation model. The library requires Go 1.27 or newer, and its public API is still under active development.
It separates wire-protocol adapters from model and provider metadata. Every adapter supports generation, typed stream events, classified errors, and token usage. Built-in protocols include OpenAI Responses, Azure OpenAI Responses, OpenAI-compatible Chat Completions, ChatGPT subscription Codex Responses, Anthropic-compatible Messages, Gemini Developer API, Google Vertex AI, Amazon Bedrock ConverseStream, and Mistral Conversations. Model-scoped features must still be declared by the configured model.
Portable orchestration helpers are opt-in and do not change provider defaults. These include bounded retries, stream collection, structural collection, tool strictness, history transformation, token budgeting, tool argument validation, context-overflow detection, and JSON repair helpers. Tool inputs use JSON Schema 2020-12 by default and support declared drafts and local references offline.
Custom protocols and dynamic catalogs are supported through an immutable factory registry and a catalog manager that publishes a static baseline plus validated provider overlays. Built-in provider profiles supply protocol and endpoint defaults for services such as OpenRouter, Groq, DeepSeek, xAI, Cerebras, Fireworks, Mistral, Google Vertex, and Amazon Bedrock. Local servers exposing an OpenAI-compatible /v1/chat/completions endpoint use the openai adapter.
Pricing
Free
Detailed plans have not been confirmed in our catalog. Check the official website for current limits and billing terms.
Visit WebsitePrices and limits may change. Confirm the currency, billing period, seat minimum and usage caps on the official website.
Use Cases
- Teams use llm-go to switch between model providers without changing their conversation model.
- Teams use llm-go to perform synchronous generation and lifecycle-safe streaming with typed events.
- Teams use llm-go to handle multi-turn reasoning replay, prompt caching, and usage/cost accounting.
- Teams use llm-go to coerce and validate model-generated tool arguments through JSON Schema.
- Teams use llm-go to repair malformed JSON and read partial streaming JSON.
- Teams use llm-go to connect local OpenAI-compatible servers such as Ollama and llama.cpp.
- Teams use llm-go to dynamically fetch models from models.dev.
Features
Provider-neutral Go library
LLM generation and streaming
Tool call support
Multimodal input handling
Reasoning replay support
Usage and pricing information
Reviews
No reviews yet. Be the first to share your experience!