| 186 | // --------------------------------------------------------------------------- |
| 187 | |
| 188 | interface ExistingModel { |
| 189 | name?: string; |
| 190 | family?: string; |
| 191 | attachment?: boolean; |
| 192 | reasoning?: boolean; |
| 193 | tool_call?: boolean; |
| 194 | structured_output?: boolean; |
| 195 | temperature?: boolean; |
| 196 | knowledge?: string; |
| 197 | release_date?: string; |
| 198 | last_updated?: string; |
| 199 | open_weights?: boolean; |
| 200 | interleaved?: boolean | { field: string }; |
| 201 | status?: string; |
| 202 | cost?: { |
| 203 | input?: number; |
| 204 | output?: number; |
| 205 | cache_read?: number; |
| 206 | cache_write?: number; |
| 207 | context_over_200k?: { |
| 208 | input?: number; |
| 209 | output?: number; |
| 210 | cache_read?: number; |
| 211 | cache_write?: number; |
| 212 | context_min?: number; |
| 213 | }; |
| 214 | tiers?: Array<{ |
| 215 | tier: { |
| 216 | type?: "context"; |
| 217 | size: number; |
| 218 | }; |
| 219 | input?: number; |
| 220 | output?: number; |
| 221 | cache_read?: number; |
| 222 | cache_write?: number; |
| 223 | }>; |
| 224 | }; |
| 225 | limit?: { |
| 226 | context?: number; |
| 227 | input?: number; |
| 228 | output?: number; |
| 229 | }; |
| 230 | modalities?: { |
| 231 | input?: string[]; |
| 232 | output?: string[]; |
| 233 | }; |
| 234 | } |
| 235 | |
| 236 | async function loadExisting(filePath: string): Promise<ExistingModel | null> { |
| 237 | const file = Bun.file(filePath); |
nothing calls this directly
no outgoing calls
no test coverage detected