Coverage for integrations / providers / __init__.py: 100.0%
3 statements
« prev ^ index » next coverage.py v7.14.0, created at 2026-05-12 04:49 +0000
« prev ^ index » next coverage.py v7.14.0, created at 2026-05-12 04:49 +0000
1"""
2Universal Provider Gateway — route any AI task to the optimal provider.
4Nunba becomes the everything app: agents call the gateway, gateway routes
5to the cheapest/fastest provider, earns commission where available.
7Architecture:
8 ProviderRegistry — catalog of all providers + their capabilities/pricing
9 ProviderGateway — smart router: pick provider, call API, track cost
10 EfficiencyMatrix — continuous benchmarking: tok/s, latency, quality per provider
12Providers fall into two categories:
13 1. Raw API providers (direct integration, we pay API cost):
14 Replicate, Together AI, Fireworks AI, fal.ai, DeepInfra, Groq,
15 Cerebras, SambaNova, RunPod, Modal, HuggingFace Inference, OpenRouter
17 2. Business services (affiliate/commission, user pays them):
18 Seedance, RunwayML, Pika, Kling, Luma, ElevenLabs, Midjourney, etc.
20For (1): agents use the model directly via gateway. Nunba pays provider,
21 charges user credits. Margin = credit price - API cost.
22For (2): agents recommend/redirect. Revenue = affiliate commission.
24Both types register as agent tools automatically.
25"""
27from integrations.providers.registry import ProviderRegistry, get_registry
28from integrations.providers.gateway import ProviderGateway, get_gateway
30__all__ = ['ProviderRegistry', 'get_registry', 'ProviderGateway', 'get_gateway']