| 49 | name: "LLM Gateway", |
| 50 | modelsDir: "providers/llmgateway/models", |
| 51 | async fetchModels() { |
| 52 | const headers = process.env.LLMGATEWAY_API_KEY |
| 53 | ? { Authorization: `Bearer ${process.env.LLMGATEWAY_API_KEY}` } |
| 54 | : undefined; |
| 55 | const response = await fetch(API_ENDPOINT, { headers }); |
| 56 | if (!response.ok) { |
| 57 | throw new Error(`LLM Gateway request failed: ${response.status} ${response.statusText}`); |
| 58 | } |
| 59 | return response.json(); |
| 60 | }, |
| 61 | parseModels(raw) { |
| 62 | return LLMGatewayResponse.parse(raw).data.filter((model) => { |
| 63 | const output = model.architecture.output_modalities; |