Open History to see the last commit
1/**
2 * Hand-written wrapper. DO NOT regenerate this file.
3 *
4 * The model data lives in `neon.models.json` (regenerated by
5 * `fetch-neon-models.ts`). This wrapper re-exports it typed so consumers can
6 * keep `import { models } from './neon.models'`.
7 *
8 * The data is loaded via `JSON.parse(readFileSync(...))` rather than an
9 * `import ... with { type: 'json' }` attribute so the loader doesn't have
10 * to support JSON import attributes.
11 */
12
13import { readFileSync } from 'node:fs'
14import { dirname, resolve } from 'node:path'
15import { fileURLToPath } from 'node:url'
16
17export interface NeonCatalogModel {
18 id: string
19 provider?: string
20 released?: boolean
21 /** `'embedding'` for an embedding model. Chat models have no `type`. */
22 type?: string
23 reasoning?: boolean
24 reasoning_options?: Array<{ type: string; values?: Array<string> }>
25 /** `false` when the model rejects `temperature` (and `top_p`). */
26 temperature?: boolean
27 modalities?: {
28 input?: Array<string>
29 output?: Array<string>
30 }
31 capabilities?: {
32 /** How `/v1/chat/completions` serves the model. */
33 chat?: 'conforms' | 'array-content' | 'not-served' | (string & {})
34 /** Whether `/openai/v1/responses` serves the model. */
35 responses?: boolean
36 native_dialect?: string
37 embeddings?: boolean
38 }
39 [key: string]: unknown
40}
41
42const __dirname = dirname(fileURLToPath(import.meta.url))
43const DATA_PATH = resolve(__dirname, 'neon.models.json')
44
45export const models: Array<NeonCatalogModel> = JSON.parse(
46 readFileSync(DATA_PATH, 'utf-8'),
47)