2026-06-13 10:08:37 -04:00
|
|
|
// Barrel: PROVIDERS now built from providers/registry (transport co-located with models)
|
2026-06-14 02:15:48 -04:00
|
|
|
import { PROVIDERS } from "../providers/index.js";
|
|
|
|
|
export { PROVIDERS, PROVIDER_OAUTH } from "../providers/index.js";
|
2026-04-21 23:42:34 -04: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 05:26:35 -04:00
|
|
|
|
2026-06-14 02:15:48 -04: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 05:26:35 -04:00
|
|
|
|
|
|
|
|
export function resolveXiaomiTokenplanBaseUrl(credentials) {
|
|
|
|
|
const region = credentials?.providerSpecificData?.region;
|
|
|
|
|
return XIAOMI_TOKENPLAN_REGIONS[region] || XIAOMI_TOKENPLAN_REGIONS[XIAOMI_TOKENPLAN_DEFAULT_REGION];
|
|
|
|
|
}
|