AYXZA Relay is a gateway library that unifies access, routing, fallback, caching and knowledge base across OpenAI, Anthropic, Google Gemini, Vertex AI and any OpenAI-compatible endpoint (Groq, DeepSeek, OpenRouter, Ollama, vLLM) — with a single Python interface.
Adding AI to a product is no longer "calling an API". It means juggling five vendors, containing costs, guaranteeing uptime and protecting data. AYXZA Relay solves all of this with a single library.
forge.chat()Single API: forge.chat() works with any modelConservative estimate on a SaaS product with 10,000 AI calls/day.
Pure Python library, stateless where possible, with persistence on PostgreSQL + pgvector. No external service dependency beyond the LLM providers themselves.
# 1. Inizializzazione — provider configurati una volta sola from forge_ai import Forge forge = Forge( providers=["openai", "anthropic", "gemini", "ollama"], fallback_chain=["openai", "anthropic"], tracking=True, tenant_id="acme-corp", ) # 2. Chat — il router sceglie il modello migliore per il task response = forge.chat( prompt="Riassumi questo contratto in 3 punti", model="auto", # o "claude-sonnet-4-5", "gpt-4o", "llama3.1:70b" max_tokens=500, ) print(response.text, response.cost_usd, response.provider_used) # 3. Output strutturato nativo (Gemini / OpenAI) from pydantic import BaseModel class Invoice(BaseModel): total: float vat: float items: list[str] invoice = forge.chat( prompt="Estrai i dati da questa fattura...", output_schema=Invoice, ).parsed # 4. RAG — knowledge base con isolamento per tenant forge.kb.add_source(name="company-policies", files=["./docs/*.pdf"]) answer = forge.rag( query="Qual è la policy sui rimborsi spese?", sources=["company-policies"], ) # 5. Locale — stesso codice, modello Ollama on-prem private = forge.chat(prompt="...", model="ollama:llama3.1:70b")
| Capability | OpenAI | Anthropic | Gemini | Vertex | Ollama |
|---|---|---|---|---|---|
| Chat completion | ● | ● | ● | ● | ● |
| Streaming | ● | — | ● | — | ● |
| Structured output (native) | ● | — | ● | ● | — |
| Function calling | ● | ● | ● | ● | ● |
| Embeddings | ● | — | ● | ● | ● |
| Vision · multimodal | ● | ● | ● | ● | ● |
| On-premise · air-gapped | — | — | — | — | ● |
All major cloud LLM vendors, plus an OpenAI-compatible adapter reaching cloud engines (Groq, DeepSeek, OpenRouter) and local (Ollama, vLLM) air-gapped deployments.
ProviderAdding a new provider takes ~150 lines of Python implementing the Provider interface.To evaluate an integration, discuss a use case or get a personalized demo on your product.