2026-06-13 21:08:37 +07:00
|
|
|
// Barrel: PROVIDERS now built from providers/registry (transport co-located with models)
|
2026-06-14 13:15:48 +07:00
|
|
|
import { PROVIDERS } from "../providers/index.js";
|
|
|
|
|
export { PROVIDERS, PROVIDER_OAUTH } from "../providers/index.js";
|
2026-04-22 10:42:34 +07:00
|
|
|
|
|
|
|
|
export const OLLAMA_LOCAL_DEFAULT_HOST = "http://localhost:11434";
|
|
|
|
|
|
|
|
|
|
export function resolveOllamaLocalHost(credentials) {
|
|
|
|
|
const raw = credentials?.providerSpecificData?.baseUrl?.trim();
|
|
|
|
|
return (raw || OLLAMA_LOCAL_DEFAULT_HOST).replace(/\/$/, "");
|
|
|
|
|
}
|
2026-05-18 16:26:35 +07:00
|
|
|
|
2026-06-14 13:15:48 +07:00
|
|
|
// Region URLs single-source from registry xiaomi-tokenplan.transport
|
|
|
|
|
export const XIAOMI_TOKENPLAN_REGIONS = PROVIDERS["xiaomi-tokenplan"]?.regions || {};
|
|
|
|
|
export const XIAOMI_TOKENPLAN_DEFAULT_REGION = PROVIDERS["xiaomi-tokenplan"]?.defaultRegion;
|
2026-05-18 16:26:35 +07:00
|
|
|
|
|
|
|
|
export function resolveXiaomiTokenplanBaseUrl(credentials) {
|
|
|
|
|
const region = credentials?.providerSpecificData?.region;
|
|
|
|
|
return XIAOMI_TOKENPLAN_REGIONS[region] || XIAOMI_TOKENPLAN_REGIONS[XIAOMI_TOKENPLAN_DEFAULT_REGION];
|
|
|
|
|
}
|