The openai-compatible provider allows you to connect to any service implementing the OpenAI API format. This is ideal for local deployments (like LM Studio, Ollama, vLLM, or LocalAI) and custom cloud services.
Supported Capabilities:
- Language Models (LLM): Supported via chat completions endpoints.
- Embeddings: Supported.
- Speech-to-Text (STT): Supported.
- Text-to-Speech (TTS): Supported.
- Reranking: Not supported.
To use a local service like LM Studio, ensure the server is running (e.g., at http://localhost:1234) before attempting to connect.
from esperanto.factory import AIFactory
# Language model
model = AIFactory.create_language(
"openai-compatible",
"your-model-name",
config={"base_url": "http://localhost:1234/v1"}
)