Files
openclaw/extensions/deepinfra/media-models.ts
Georgi Atsev 9e7c2b356b fix(deepinfra): load all DeepInfra models when user wants to browse t… (#84549)
* fix(deepinfra): load all DeepInfra models when user wants to browse them during onboarding

* docs(deepinfra): align TTS default

* fix(deepinfra): refresh video fallbacks

* fix(deepinfra): share credential-aware catalog discovery

* test(deepinfra): narrow catalog regression types

* test(deepinfra): keep catalog narrowing across callback

* fix(deepinfra): preserve default model in live catalog

* fix(deepinfra): align default model pricing

* fix(deepinfra): keep pixverse as video default

* docs(deepinfra): match video fallback default

* fix(deepinfra): honor config api keys for live catalog

* test(e2e): wait for watchdog stdio close

* test(media): align live harness provider expectation

* fix(deepinfra): always augment custom catalogs

* test(e2e): resolve watchdog commands before spawning

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-27 10:43:37 +01:00

55 lines
1.9 KiB
TypeScript

import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
import { DEEPINFRA_BASE_URL } from "./provider-models.js";
export { DEEPINFRA_BASE_URL };
export const DEEPINFRA_NATIVE_BASE_URL = "https://api.deepinfra.com/v1/inference";
// Structural capability shapes — not model IDs.
export const DEFAULT_DEEPINFRA_IMAGE_SIZE = "1024x1024";
export const DEFAULT_DEEPINFRA_TTS_VOICE = "af_bella";
export const DEEPINFRA_VIDEO_ASPECT_RATIOS = ["16:9", "4:3", "1:1", "3:4", "9:16"] as const;
export const DEEPINFRA_VIDEO_DURATIONS = [5, 8] as const;
// Per-surface fallback lists — used when no discovered/static catalog is
// supplied. First entry is the default. Prefer discoverDeepInfraSurfaces().
export const DEEPINFRA_IMAGE_FALLBACK_MODELS = [
"black-forest-labs/FLUX-1-schnell",
"run-diffusion/Juggernaut-Lightning-Flux",
"black-forest-labs/FLUX-1-dev",
"Qwen/Qwen-Image-Max",
"stabilityai/sdxl-turbo",
] as const;
export const DEEPINFRA_TTS_FALLBACK_MODELS = [
"hexgrad/Kokoro-82M",
"Qwen/Qwen3-TTS",
"ResembleAI/chatterbox-turbo",
"sesame/csm-1b",
] as const;
export const DEEPINFRA_VIDEO_FALLBACK_MODELS = [
"Pixverse/Pixverse-T2V",
"Pixverse/Pixverse-T2V-HD",
"Wan-AI/Wan2.6-T2V",
"google/veo-3.1-fast",
] as const;
export const DEEPINFRA_STT_FALLBACK_MODELS = [
"openai/whisper-large-v3-turbo",
"openai/whisper-large-v3",
] as const;
export const DEEPINFRA_EMBED_FALLBACK_MODELS = ["BAAI/bge-m3"] as const;
export const DEEPINFRA_VLM_FALLBACK_MODELS = ["moonshotai/Kimi-K2.5"] as const;
export function normalizeDeepInfraModelRef(model: string | undefined, fallback: string): string {
const value = normalizeOptionalString(model) ?? fallback;
return value.startsWith("deepinfra/") ? value.slice("deepinfra/".length) : value;
}
export function normalizeDeepInfraBaseUrl(value: unknown, fallback = DEEPINFRA_BASE_URL): string {
return (normalizeOptionalString(value) ?? fallback).replace(/\/+$/u, "");
}