| 135 | // ── Helpers ────────────────────────────────────────────────────────── |
| 136 | |
| 137 | function buildModels(baseUrl) { |
| 138 | return { |
| 139 | baseUrl, |
| 140 | api: "openai-completions", |
| 141 | apiKey: "uncommon-route-local-proxy", |
| 142 | models: MODELS.map((m) => ({ |
| 143 | id: m.id, |
| 144 | name: m.name, |
| 145 | api: "openai-completions", |
| 146 | reasoning: m.reasoning, |
| 147 | input: ["text"], |
| 148 | cost: { input: m.input, output: m.output, cacheRead: 0, cacheWrite: 0 }, |
| 149 | contextWindow: m.ctx, |
| 150 | maxTokens: m.max, |
| 151 | })), |
| 152 | }; |
| 153 | } |
| 154 | |
| 155 | async function waitForHealth(port, timeoutMs = HEALTH_TIMEOUT_MS) { |
| 156 | const url = `http://127.0.0.1:${port}/health`; |