Mozilla.ai has released any-llm-go, bringing its unified interface for interacting with large language models (LLMs) to the Go programming language. This move aims to provide Go developers with the same flexibility previously available to Python developers, enabling them to switch between cloud or local LLM providers without rewriting code.
The original any-llm v1.0, launched last year, addressed the need for a single API to manage diverse model providers. This Go integration, detailed in an announcement from Mozilla.ai, extends this capability to Go, a language prevalent in production infrastructure.
Unified Provider Interface
Any-llm-go normalizes the disparate behaviors of LLM providers, such as streaming nuances, error semantics, and feature support, under a consistent interface that adheres to OpenAI API standards. This ensures a predictable developer experience.
The library ships with out-of-the-box support for eight providers, including Anthropic, DeepSeek, Gemini, Groq, Llamafile, Mistral, Ollama, and OpenAI. It clearly delineates support for core functionalities like text completion, streaming, tool usage, reasoning, and embeddings across these providers.
- Anthropic: Supports Completion, Streaming, Tools, Reasoning. Lacks Embeddings.
- DeepSeek: Supports Completion, Streaming, Tools, Reasoning. Lacks Embeddings.
- Gemini: Supports Completion, Streaming, Tools, Reasoning, and Embeddings.
- Groq: Supports Completion, Streaming, Tools. Lacks Reasoning and Embeddings.
- Llamafile: Supports Completion, Streaming, Tools, and Embeddings. Lacks Reasoning.
- Mistral: Supports Completion, Streaming, Tools, Reasoning, and Embeddings.
- Ollama: Supports Completion, Streaming, Tools, Reasoning, and Embeddings.
- OpenAI: Supports Completion, Streaming, Tools, Reasoning, and Embeddings.
Developers can write their application logic once and switch providers simply by changing an import statement and model name, maintaining consistent request shapes, streaming logic, and error handling.
