Files
OmniRoute/src/lib/providers/staticModels.ts
Paijo 76d697bb88 chore: remove 9 dead/unreachable free providers (#3054)
* chore: remove 9 dead/unreachable free providers

Verified via HTTP probe — API endpoints return 000/404/empty:
- freetheai, enally, replicate, lepton, poolside, nomic
- astraflow, petals, nanobanana (phantom: catalog but no registry)

Also removed from: providerRegistry.ts, validation.ts,
staticModels.ts, imageValidation.ts, open-sse/config/petals.ts

* chore: remove dead astraflow providers

Remove astraflow and astraflow-cn (UCloud) — API endpoints unreachable.
Remaining dead providers (enally, freetheai, nanobanana, replicate,
lepton, petals, poolside, nomic) have working main sites but dead API
endpoints — need API keys. Will remove in follow-up.

* chore: remove 9 dead/unreachable free providers

Removed: freetheai, enally, replicate, lepton, poolside, nomic,
astraflow, petals, nanobanana

All verified as dead via live API probes (000/404/empty responses).
Cleaned from providers.ts, providerRegistry.ts, validation.ts,
staticModels.ts, and imageValidation.ts.

---------

Co-authored-by: oyi77 <oyi77@users.noreply.github.com>
2026-06-01 22:29:30 -03:00

127 lines
4.6 KiB
TypeScript

import { getEmbeddingProvider } from "@omniroute/open-sse/config/embeddingRegistry.ts";
import { getRerankProvider } from "@omniroute/open-sse/config/rerankRegistry.ts";
import { getImageProvider } from "@omniroute/open-sse/config/imageRegistry.ts";
import { getVideoProvider } from "@omniroute/open-sse/config/videoRegistry.ts";
import {
getSpeechProvider,
getTranscriptionProvider,
} from "@omniroute/open-sse/config/audioRegistry.ts";
import { ANTIGRAVITY_PUBLIC_MODELS } from "@omniroute/open-sse/config/antigravityModelAliases.ts";
import { getStaticQoderModels } from "@omniroute/open-sse/services/qoderCli.ts";
import { getModelsByProviderId } from "@/shared/constants/models";
export type LocalCatalogModel = {
id: string;
name?: string;
apiFormat?: string;
supportedEndpoints?: string[];
};
const STATIC_MODEL_PROVIDERS: Record<string, () => Array<{ id: string; name: string }>> = {
deepgram: () => [
{ id: "nova-3", name: "Nova 3 (Transcription)" },
{ id: "nova-2", name: "Nova 2 (Transcription)" },
{ id: "whisper-large", name: "Whisper Large (Transcription)" },
{ id: "aura-asteria-en", name: "Aura Asteria EN (TTS)" },
{ id: "aura-luna-en", name: "Aura Luna EN (TTS)" },
{ id: "aura-stella-en", name: "Aura Stella EN (TTS)" },
],
assemblyai: () => [
{ id: "universal-3-pro", name: "Universal 3 Pro (Transcription)" },
{ id: "universal-2", name: "Universal 2 (Transcription)" },
],
antigravity: () => ANTIGRAVITY_PUBLIC_MODELS.map((model) => ({ ...model })),
claude: () => [
{ id: "claude-opus-4-8", name: "Claude Opus 4.8" },
{ id: "claude-opus-4-7", name: "Claude Opus 4.7" },
{ id: "claude-opus-4-6", name: "Claude Opus 4.6" },
{ id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6" },
{ id: "claude-opus-4-5-20251101", name: "Claude Opus 4.5 (2025-11-01)" },
{ id: "claude-sonnet-4-5-20250929", name: "Claude Sonnet 4.5 (2025-09-29)" },
{ id: "claude-haiku-4-5-20251001", name: "Claude Haiku 4.5 (2025-10-01)" },
],
perplexity: () => [
{ id: "sonar", name: "Sonar (Fast Search)" },
{ id: "sonar-pro", name: "Sonar Pro (Advanced Search)" },
{ id: "sonar-reasoning", name: "Sonar Reasoning (CoT + Search)" },
{ id: "sonar-reasoning-pro", name: "Sonar Reasoning Pro (Advanced CoT + Search)" },
{ id: "sonar-deep-research", name: "Sonar Deep Research (Expert Analysis)" },
],
"bailian-coding-plan": () => [
{ id: "qwen3.6-plus", name: "Qwen3.6 Plus(vision)" },
{ id: "qwen3.5-plus", name: "Qwen3.5 Plus(vision)" },
{ id: "qwen3-max-2026-01-23", name: "Qwen3 Max" },
{ id: "kimi-k2.5", name: "Kimi K2.5(vision)" },
{ id: "glm-5", name: "GLM 5" },
{ id: "MiniMax-M2.5", name: "MiniMax M2.5" },
],
gitlab: () => [{ id: "gitlab-duo-code-suggestions", name: "GitLab Duo Code Suggestions" }],
nlpcloud: () =>
getModelsByProviderId("nlpcloud").map((model) => ({
id: model.id,
name: model.name || model.id,
})),
qoder: () => getStaticQoderModels(),
};
export function getStaticModelsForProvider(provider: string): LocalCatalogModel[] | undefined {
const staticModelsFn = STATIC_MODEL_PROVIDERS[provider];
if (staticModelsFn) {
return staticModelsFn();
}
const specialtyModels: LocalCatalogModel[] = [];
const appendModels = (
models: Array<{ id: string; name?: string }>,
metadata?: Pick<LocalCatalogModel, "apiFormat" | "supportedEndpoints">
) => {
for (const model of models) {
if (specialtyModels.some((existing) => existing.id === model.id)) continue;
specialtyModels.push({
id: model.id,
name: model.name || model.id,
...metadata,
});
}
};
const embeddingProvider = getEmbeddingProvider(provider);
if (embeddingProvider) {
appendModels(embeddingProvider.models, {
apiFormat: "embeddings",
supportedEndpoints: ["embeddings"],
});
}
const rerankProvider = getRerankProvider(provider);
if (rerankProvider) {
appendModels(rerankProvider.models, {
apiFormat: "rerank",
supportedEndpoints: ["rerank"],
});
}
const imageProvider = getImageProvider(provider);
if (imageProvider) {
appendModels(imageProvider.models);
}
const videoProvider = getVideoProvider(provider);
if (videoProvider) {
appendModels(videoProvider.models);
}
const speechProvider = getSpeechProvider(provider);
if (speechProvider) {
appendModels(speechProvider.models);
}
const transcriptionProvider = getTranscriptionProvider(provider);
if (transcriptionProvider) {
appendModels(transcriptionProvider.models);
}
return specialtyModels.length > 0 ? specialtyModels : undefined;
}