Polyglot \ Internals
Overview of Architecture
A detailed look at Polyglot’s internal architecture
This section provides a detailed look at Polyglot’s internal architecture.
Understanding the core components, interfaces, and design patterns will help you extend the library, contribute to its development, or build your own integrations with new LLM providers.
Core Architecture
Polyglot is built on a modular, layered architecture that separates concerns and promotes extensibility. The high-level architecture consists of:
- Public API Layer: Classes like
Inference
andEmbeddings
that provide a unified interface for applications - Provider Abstraction Layer: Adapters, drivers, and formatters that translate between the unified API and provider-specific formats
- HTTP Client Layer: A flexible HTTP client with middleware support for communicating with LLM APIs
- Configuration Layer: Configuration management for different providers and models