fix config generator bug (#599)

This commit is contained in:
Adil Hafeez 2025-10-23 18:50:23 -07:00 committed by GitHub
parent a180fed52d
commit 0ee0912a73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 36 additions and 7 deletions

View file

@ -295,19 +295,18 @@ def validate_and_render_schema():
}
)
updated_model_providers = []
config_yaml["model_providers"] = deepcopy(updated_model_providers)
listeners_with_provider = 0
for listener in listeners:
print("Processing listener: ", listener)
model_providers = listener.get("model_providers", None)
if model_providers is not None and model_providers != []:
print("processing egress traffic listener")
print("updated_model_providers: ", updated_model_providers)
if updated_model_providers is not None and updated_model_providers != []:
if model_providers is not None:
listeners_with_provider += 1
if listeners_with_provider > 1:
raise Exception(
"Please provide model_providers either under listeners or at root level, not both. Currently we don't support multiple listeners with model_providers"
)
updated_model_providers = deepcopy(model_providers)
config_yaml["model_providers"] = updated_model_providers
# Validate model aliases if present
if "model_aliases" in config_yaml:

View file

@ -27,3 +27,33 @@ model: Arch-Router
### get model list from Arch-Router (notice model header)
GET https://archfc.katanemo.dev/v1/models HTTP/1.1
model: Arch-Router
### test try code generating
POST http://localhost:12000/v1/chat/completions HTTP/1.1
Content-Type: application/json
{
"model": "none",
"messages": [
{
"role": "user",
"content": "write code in python to generate a random number between 1 and 10"
}
]
}
### test try code understanding
POST http://localhost:12000/v1/chat/completions HTTP/1.1
Content-Type: application/json
{
"model": "none",
"messages": [
{
"role": "user",
"content": "help me understand this python code:\n\nimport random\n\ndef generate_random_number():\n return random.randint(1, 10)\n\nprint(generate_random_number())"
}
]
}