Merge pull request #332 from mrexodia/fix-models-sorting

Make model generation deterministic by sorting providers and models
This commit is contained in:
Mario Zechner 2025-12-27 18:36:24 +01:00 committed by GitHub
commit c193ef74d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6385 additions and 6381 deletions

View file

@ -662,11 +662,15 @@ import type { Model } from "./types.js";
export const MODELS = {
`;
// Generate provider sections
for (const [providerId, models] of Object.entries(providers)) {
// Generate provider sections (sorted for deterministic output)
const sortedProviderIds = Object.keys(providers).sort();
for (const providerId of sortedProviderIds) {
const models = providers[providerId];
output += `\t${JSON.stringify(providerId)}: {\n`;
for (const model of Object.values(models)) {
const sortedModelIds = Object.keys(models).sort();
for (const modelId of sortedModelIds) {
const model = models[modelId];
output += `\t\t"${model.id}": {\n`;
output += `\t\t\tid: "${model.id}",\n`;
output += `\t\t\tname: "${model.name}",\n`;

File diff suppressed because it is too large Load diff