mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-19 21:52:21 +03:00
feat: use getModelInfo for proper custom provider resolution in availability checks
This commit is contained in:
@@ -156,13 +156,14 @@ export async function handleChat(request: any, clientRawRequest: any = null) {
|
||||
// Pre-check function: skip models where all accounts are in cooldown
|
||||
// Uses modelAvailability module for TTL-based cooldowns
|
||||
const checkModelAvailable = async (modelString: string) => {
|
||||
const parsed = parseModel(modelString);
|
||||
const provider = parsed.provider;
|
||||
// Use getModelInfo to properly resolve custom prefixes
|
||||
const modelInfo = await getModelInfo(modelString);
|
||||
const provider = modelInfo.provider;
|
||||
if (!provider) return true; // can't determine provider, let it try
|
||||
|
||||
// Check domain-level availability (cooldown)
|
||||
if (!isModelAvailable(provider, parsed.model || modelString)) {
|
||||
log.debug("AVAILABILITY", `${provider}/${parsed.model} in cooldown, skipping`);
|
||||
if (!isModelAvailable(provider, modelInfo.model || modelString)) {
|
||||
log.debug("AVAILABILITY", `${provider}/${modelInfo.model} in cooldown, skipping`);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user