fed8b2eed7
Build and push multi-arch DocsGPT Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Has been cancelled
Backend release / release (push) Has been cancelled
Bandit Security Scan / bandit_scan (push) Has been cancelled
Build and push multi-arch DocsGPT Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Has been cancelled
Build and push multi-arch DocsGPT Docker image / manifest (push) Has been cancelled
Build and push DocsGPT FE Docker image for development / build (linux/amd64, ubuntu-latest, amd64) (push) Has been cancelled
Build and push DocsGPT FE Docker image for development / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Has been cancelled
Build and push DocsGPT FE Docker image for development / manifest (push) Has been cancelled
Python linting / ruff (push) Has been cancelled
Run python tests with pytest / Run tests and count coverage (3.12) (push) Has been cancelled
React Widget Build / build (push) Has been cancelled
50 lines
1.9 KiB
Python
50 lines
1.9 KiB
Python
"""Provider plugin registry.
|
|
|
|
Plugins are imported eagerly so import errors surface at app boot rather
|
|
than at first request. ``ALL_PROVIDERS`` is the canonical ordered list;
|
|
``PROVIDERS_BY_NAME`` is a name-keyed lookup for LLMCreator and the
|
|
model registry.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Dict, List
|
|
|
|
from application.llm.providers.anthropic import AnthropicProvider
|
|
from application.llm.providers.base import Provider
|
|
from application.llm.providers.docsgpt import DocsGPTProvider
|
|
from application.llm.providers.google import GoogleProvider
|
|
from application.llm.providers.groq import GroqProvider
|
|
from application.llm.providers.huggingface import HuggingFaceProvider
|
|
from application.llm.providers.llama_cpp import LlamaCppProvider
|
|
from application.llm.providers.novita import NovitaProvider
|
|
from application.llm.providers.openai import OpenAIProvider
|
|
from application.llm.providers.openai_compatible import OpenAICompatibleProvider
|
|
from application.llm.providers.openrouter import OpenRouterProvider
|
|
from application.llm.providers.premai import PremAIProvider
|
|
from application.llm.providers.sagemaker import SagemakerProvider
|
|
|
|
# Order here is the order the registry iterates providers (and therefore
|
|
# the order ``/api/models`` reports them). Match the historical order
|
|
# from the old ModelRegistry._load_models for byte-stable output during
|
|
# the migration. ``openai_compatible`` slots in right after ``openai``
|
|
# so legacy ``OPENAI_BASE_URL`` models keep landing in the same place.
|
|
ALL_PROVIDERS: List[Provider] = [
|
|
DocsGPTProvider(),
|
|
OpenAIProvider(),
|
|
OpenAICompatibleProvider(),
|
|
AnthropicProvider(),
|
|
GoogleProvider(),
|
|
GroqProvider(),
|
|
OpenRouterProvider(),
|
|
NovitaProvider(),
|
|
HuggingFaceProvider(),
|
|
LlamaCppProvider(),
|
|
PremAIProvider(),
|
|
SagemakerProvider(),
|
|
]
|
|
|
|
PROVIDERS_BY_NAME: Dict[str, Provider] = {p.name: p for p in ALL_PROVIDERS}
|
|
|
|
__all__ = ["ALL_PROVIDERS", "PROVIDERS_BY_NAME", "Provider"]
|