Overview of LLM features
mainLLM is a unified Rust library for interacting with multiple LLM providers through a single API.
Core Capabilities:
- Unified API: Use
ChatProviderandCompletionProvidertraits to interact with providers like OpenAI, Anthropic, Ollama, Google, and more. - Chaining: Create multi-step chains where different backends are used at different stages.
- Advanced Prompting: Use templates for variable injection and structured output via JSON schemas.
- Resilience: Built-in support for retries and exponential backoff.
- Evaluation: Score LLM outputs and perform parallel evaluation across multiple providers to select the best response.
- Agentic Workflows: Build reactive agents with shared memory, roles, and validation.
- Multimodal & Audio: Support for Vision (images), Speech-to-Text (transcription), and Text-to-Speech.
- Memory: Manage conversation history using sliding windows or shared memory.