LLM Clients¶
AI-Parrot talks to every LLM provider through a single
AbstractClient interface, so the same agent code can run on OpenAI,
Anthropic, Google GenAI, Groq, VertexAI or HuggingFace without changes.
What lives here¶
AbstractClient— async base class withcompletion(),stream()andembed(). Every provider wrapper inherits from it.- Provider clients — concrete implementations under
parrot.clients.*(one module per vendor). LLM_PRESETS— opinionated configurations for the most common models (temperature, max tokens, retry budget).StreamingRetryConfig— retry policy applied around streaming completions, including back-off and partial-response handling.- Embeddings —
parrot.embeddingscovers dense and sparse embedding back-ends used by the RAG pipeline.
flowchart LR
Agent --> AbstractClient
AbstractClient --> OpenAI
AbstractClient --> Anthropic
AbstractClient --> Groq
AbstractClient --> VertexAI
AbstractClient --> HuggingFace
Golden rules¶
- Never call a provider SDK directly — always go through
AbstractClient. This is the seam that keeps the framework vendor agnostic. awaiteverything — clients are async only. Wrapping them withasyncio.runinside another coroutine will block the event loop.- Don't subclass
AbstractClientlightly — discuss the change first; it's the foundation that all bots and crews assume.
Read next¶
- Per-loop Caching — how the client layer caches completions inside a single agent turn.
- Contextual Embedding
- Matryoshka Embeddings