@opencode-ai/models 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +108 -0
- package/dist/client.d.ts +36 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +61 -0
- package/dist/client.js.map +1 -0
- package/dist/effect/client.d.ts +45 -0
- package/dist/effect/client.d.ts.map +1 -0
- package/dist/effect/client.js +37 -0
- package/dist/effect/client.js.map +1 -0
- package/dist/effect.d.ts +4 -0
- package/dist/effect.d.ts.map +1 -0
- package/dist/effect.js +4 -0
- package/dist/effect.js.map +1 -0
- package/dist/error.d.ts +14 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +16 -0
- package/dist/error.js.map +1 -0
- package/dist/generated.d.ts +3 -0
- package/dist/generated.d.ts.map +1 -0
- package/dist/generated.js +3 -0
- package/dist/generated.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/snapshot.d.ts +14 -0
- package/dist/snapshot.js +6 -0
- package/dist/types.d.ts +248 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/package.json +48 -11
- package/src/index.ts +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 models.dev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# @opencode-ai/models
|
|
2
|
+
|
|
3
|
+
Official typed client for the [models.dev](https://models.dev) API — an open-source database of AI model capabilities, pricing, and limits.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install @opencode-ai/models
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
- **Zero dependencies.** The root client is a small `fetch` wrapper; works on Node ≥ 18, Bun, Deno, browsers, and edge runtimes.
|
|
10
|
+
- **Fully typed.** Hand-written types, verified in CI to be exactly equivalent to the schemas that generate the data.
|
|
11
|
+
- **Three entrypoints.** Promise client, [Effect](https://effect.website) client, and a bundled offline snapshot.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { Models } from "@opencode-ai/models"
|
|
17
|
+
|
|
18
|
+
const client = Models.make()
|
|
19
|
+
|
|
20
|
+
const providers = await client.providers() // GET /api.json
|
|
21
|
+
providers["anthropic"]?.models["claude-opus-4-6"]?.cost?.input // USD per 1M tokens
|
|
22
|
+
|
|
23
|
+
const models = await client.models() // GET /models.json
|
|
24
|
+
models["anthropic/claude-opus-4-6"]?.knowledge // provider-agnostic metadata
|
|
25
|
+
|
|
26
|
+
const catalog = await client.catalog() // GET /catalog.json — both in one request
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
| Method | Endpoint | Contents |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| `providers()` | `/api.json` | Providers with their models, pricing, and limits |
|
|
32
|
+
| `models()` | `/models.json` | Provider-agnostic model metadata, keyed by `<lab>/<model>` |
|
|
33
|
+
| `catalog()` | `/catalog.json` | `{ providers, models }` in a single payload |
|
|
34
|
+
|
|
35
|
+
The client is **stateless**: every call performs exactly one GET, nothing is cached, and lookups are plain object access on the returned data. Cache however you like:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
let cached: Promise<ProviderMap> | undefined
|
|
39
|
+
const providers = () => (cached ??= client.providers())
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Options:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
const client = Models.make({
|
|
46
|
+
baseUrl: "https://models.dev", // default
|
|
47
|
+
fetch: myFetch, // proxies, polyfills, test doubles
|
|
48
|
+
headers: { "x-extra": "1" }, // sent with every request
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
await client.providers({ signal: AbortSignal.timeout(5000) })
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Errors are a single `ModelsDevError` with `reason: "Transport" | "UnexpectedStatus" | "MalformedResponse"` and the underlying `cause`.
|
|
55
|
+
|
|
56
|
+
## Offline snapshot
|
|
57
|
+
|
|
58
|
+
A full copy of the database ships inside the package as a separate, tree-shakable entrypoint — nothing from it is loaded or bundled unless you import it:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import snapshot, { providers, models, generatedAt } from "@opencode-ai/models/snapshot"
|
|
62
|
+
|
|
63
|
+
providers["anthropic"]?.models["claude-opus-4-6"]?.limit.context
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Use it for no-network runtimes, tests, cold-start-sensitive paths, or as an explicit fallback:
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
const providers = await client.providers().catch(async () => (await import("@opencode-ai/models/snapshot")).providers)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Freshness: the published snapshot is at most ~24h behind the live API (data releases are automated). The client is the freshness path; the snapshot is the availability path.
|
|
73
|
+
|
|
74
|
+
## Effect
|
|
75
|
+
|
|
76
|
+
An Effect-native client lives at `@opencode-ai/models/effect` (requires the optional peer dependency `effect`):
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import { Models } from "@opencode-ai/models/effect"
|
|
80
|
+
import { FetchHttpClient } from "effect/unstable/http"
|
|
81
|
+
import { Effect } from "effect"
|
|
82
|
+
|
|
83
|
+
const program = Effect.gen(function* () {
|
|
84
|
+
const client = yield* Models.make()
|
|
85
|
+
return yield* client.providers() // Effect<ProviderMap, ModelsDevError>
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
await program.pipe(Effect.provide(FetchHttpClient.layer), Effect.runPromise)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Transport comes from the environment's `HttpClient` service, so proxies, retries, tracing, and test transports compose the usual Effect way. For DI, `Models.Service` and `Models.layer(options?)` are provided:
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
const program = Effect.gen(function* () {
|
|
95
|
+
const client = yield* Models.Service
|
|
96
|
+
return yield* client.models()
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
program.pipe(Effect.provide(Models.layer().pipe(Layer.provide(FetchHttpClient.layer))))
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Types
|
|
103
|
+
|
|
104
|
+
All data types are exported from the root (and re-exported from `/effect`): `Provider`, `Model`, `ModelMetadata`, `Catalog`, `Cost`, `Limit`, `ReasoningOption`, and friends.
|
|
105
|
+
|
|
106
|
+
## Contributing
|
|
107
|
+
|
|
108
|
+
The data lives as TOML files in [anomalyco/models.dev](https://github.com/anomalyco/models.dev) — corrections and new models/providers are welcome there. This package is generated and published from that repository.
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Catalog, ModelMetadataMap, ProviderMap } from "./types.js";
|
|
2
|
+
/** Accepted anywhere headers can be passed. Same shapes as the standard `HeadersInit`. */
|
|
3
|
+
export type HeadersInput = Headers | Record<string, string> | Array<[string, string]>;
|
|
4
|
+
export interface ClientOptions {
|
|
5
|
+
/** Base URL of the models.dev deployment. Defaults to `https://models.dev`. */
|
|
6
|
+
readonly baseUrl?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Custom `fetch` implementation (proxies, polyfills, test doubles).
|
|
9
|
+
* Resolved lazily at request time, so late-installed polyfills work.
|
|
10
|
+
* Defaults to `globalThis.fetch`.
|
|
11
|
+
*/
|
|
12
|
+
readonly fetch?: typeof globalThis.fetch;
|
|
13
|
+
/** Extra headers sent with every request. */
|
|
14
|
+
readonly headers?: HeadersInput;
|
|
15
|
+
}
|
|
16
|
+
export interface RequestOptions {
|
|
17
|
+
readonly signal?: AbortSignal;
|
|
18
|
+
/** Extra headers for this request. Overrides client-level headers. */
|
|
19
|
+
readonly headers?: HeadersInput;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Creates a stateless models.dev client. Every method performs exactly one
|
|
23
|
+
* `GET` and nothing is ever cached — callers who want caching should wrap
|
|
24
|
+
* calls with their own policy. For a no-network alternative, see the
|
|
25
|
+
* `@opencode-ai/models/snapshot` entrypoint.
|
|
26
|
+
*/
|
|
27
|
+
export declare function make(options?: ClientOptions): {
|
|
28
|
+
/** All providers with their models, pricing, and limits (`/api.json`). */
|
|
29
|
+
providers: (requestOptions?: RequestOptions) => Promise<ProviderMap>;
|
|
30
|
+
/** Provider-agnostic model metadata (`/models.json`). */
|
|
31
|
+
models: (requestOptions?: RequestOptions) => Promise<ModelMetadataMap>;
|
|
32
|
+
/** Providers and model metadata in a single request (`/catalog.json`). */
|
|
33
|
+
catalog: (requestOptions?: RequestOptions) => Promise<Catalog>;
|
|
34
|
+
};
|
|
35
|
+
export type ModelsClient = ReturnType<typeof make>;
|
|
36
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExE,0FAA0F;AAC1F,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;AAErF,MAAM,WAAW,aAAa;IAC5B,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;IACxC,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAA;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;IAC7B,sEAAsE;IACtE,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAA;CAChC;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,aAAkB;IAyC5C,0EAA0E;iCAC7C,cAAc;IAC3C,yDAAyD;8BAC/B,cAAc;IACxC,0EAA0E;+BAC/C,cAAc;EAE5C;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAA"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ModelsDevError } from "./error.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a stateless models.dev client. Every method performs exactly one
|
|
4
|
+
* `GET` and nothing is ever cached — callers who want caching should wrap
|
|
5
|
+
* calls with their own policy. For a no-network alternative, see the
|
|
6
|
+
* `@opencode-ai/models/snapshot` entrypoint.
|
|
7
|
+
*/
|
|
8
|
+
export function make(options = {}) {
|
|
9
|
+
const baseUrl = options.baseUrl ?? "https://models.dev";
|
|
10
|
+
const base = baseUrl.endsWith("/") ? baseUrl : baseUrl + "/";
|
|
11
|
+
const request = async (path, requestOptions) => {
|
|
12
|
+
const fetch = options.fetch ?? globalThis.fetch;
|
|
13
|
+
const headers = new Headers();
|
|
14
|
+
for (const [key, value] of new Headers(options.headers))
|
|
15
|
+
headers.set(key, value);
|
|
16
|
+
for (const [key, value] of new Headers(requestOptions?.headers))
|
|
17
|
+
headers.set(key, value);
|
|
18
|
+
let response;
|
|
19
|
+
try {
|
|
20
|
+
response = await fetch(new URL(path, base), {
|
|
21
|
+
method: "GET",
|
|
22
|
+
headers,
|
|
23
|
+
signal: requestOptions?.signal,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
catch (cause) {
|
|
27
|
+
throw new ModelsDevError("Transport", { cause });
|
|
28
|
+
}
|
|
29
|
+
if (!response.ok) {
|
|
30
|
+
try {
|
|
31
|
+
await response.body?.cancel();
|
|
32
|
+
}
|
|
33
|
+
catch { }
|
|
34
|
+
throw new ModelsDevError("UnexpectedStatus", { cause: { status: response.status } });
|
|
35
|
+
}
|
|
36
|
+
let text;
|
|
37
|
+
try {
|
|
38
|
+
text = await response.text();
|
|
39
|
+
}
|
|
40
|
+
catch (cause) {
|
|
41
|
+
throw new ModelsDevError("Transport", { cause });
|
|
42
|
+
}
|
|
43
|
+
if (text === "")
|
|
44
|
+
throw new ModelsDevError("MalformedResponse");
|
|
45
|
+
try {
|
|
46
|
+
return JSON.parse(text);
|
|
47
|
+
}
|
|
48
|
+
catch (cause) {
|
|
49
|
+
throw new ModelsDevError("MalformedResponse", { cause });
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
/** All providers with their models, pricing, and limits (`/api.json`). */
|
|
54
|
+
providers: (requestOptions) => request("api.json", requestOptions),
|
|
55
|
+
/** Provider-agnostic model metadata (`/models.json`). */
|
|
56
|
+
models: (requestOptions) => request("models.json", requestOptions),
|
|
57
|
+
/** Providers and model metadata in a single request (`/catalog.json`). */
|
|
58
|
+
catalog: (requestOptions) => request("catalog.json", requestOptions),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAyB3C;;;;;GAKG;AACH,MAAM,UAAU,IAAI,CAAC,UAAyB,EAAE;IAC9C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,oBAAoB,CAAA;IACvD,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,GAAG,GAAG,CAAA;IAE5D,MAAM,OAAO,GAAG,KAAK,EAAK,IAAY,EAAE,cAA+B,EAAc,EAAE;QACrF,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,CAAA;QAC/C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAA;QAC7B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QAChF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QAExF,IAAI,QAAkB,CAAA;QACtB,IAAI,CAAC;YACH,QA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yDAAyD;QACzD,MAAM,EAAE,CAAC,cAA+B,EAAE,EAAE,CAAC,OAAO,CAAmB,aAAa,EAAE,cAAc,CAAC;QACrG,0EAA0E;QAC1E,OAAO,EAAE,CAAC,cAA+B,EAAE,EAAE,CAAC,OAAO,CAAU,cAAc,EAAE,cAAc,CAAC;KAC/F,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
2
|
+
import { HttpClient } from "effect/unstable/http";
|
|
3
|
+
import type { Catalog, ModelMetadataMap, ProviderMap } from "../types.js";
|
|
4
|
+
declare const ModelsDevError_base: Schema.Class<ModelsDevError, Schema.TaggedStruct<"ModelsDevError", {
|
|
5
|
+
readonly cause: Schema.Defect;
|
|
6
|
+
}>, import("effect/Cause").YieldableError>;
|
|
7
|
+
/** The only error in the failure channel of client methods. Wraps the underlying `HttpClientError` as `cause`. */
|
|
8
|
+
export declare class ModelsDevError extends ModelsDevError_base {
|
|
9
|
+
}
|
|
10
|
+
export interface ClientOptions {
|
|
11
|
+
/** Base URL of the models.dev deployment. Defaults to `https://models.dev`. */
|
|
12
|
+
readonly baseUrl?: string;
|
|
13
|
+
/** Extra headers sent with every request. */
|
|
14
|
+
readonly headers?: Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates a stateless models.dev client on top of the `HttpClient` service
|
|
18
|
+
* from the environment (`FetchHttpClient.layer`, `NodeHttpClient.layer`, or a
|
|
19
|
+
* custom transport). Nothing is ever cached — compose `Effect.cached` /
|
|
20
|
+
* `Effect.cachedWithTTL` around calls for caching.
|
|
21
|
+
*/
|
|
22
|
+
export declare const make: (options?: ClientOptions) => Effect.Effect<{
|
|
23
|
+
/** All providers with their models, pricing, and limits (`/api.json`). */
|
|
24
|
+
providers: () => Effect.Effect<ProviderMap, ModelsDevError, never>;
|
|
25
|
+
/** Provider-agnostic model metadata (`/models.json`). */
|
|
26
|
+
models: () => Effect.Effect<ModelMetadataMap, ModelsDevError, never>;
|
|
27
|
+
/** Providers and model metadata in a single request (`/catalog.json`). */
|
|
28
|
+
catalog: () => Effect.Effect<Catalog, ModelsDevError, never>;
|
|
29
|
+
}, never, HttpClient.HttpClient>;
|
|
30
|
+
export type ModelsClient = Effect.Success<ReturnType<typeof make>>;
|
|
31
|
+
declare const Service_base: Context.ServiceClass<Service, "@opencode-ai/models/Models", {
|
|
32
|
+
/** All providers with their models, pricing, and limits (`/api.json`). */
|
|
33
|
+
providers: () => Effect.Effect<ProviderMap, ModelsDevError, never>;
|
|
34
|
+
/** Provider-agnostic model metadata (`/models.json`). */
|
|
35
|
+
models: () => Effect.Effect<ModelMetadataMap, ModelsDevError, never>;
|
|
36
|
+
/** Providers and model metadata in a single request (`/catalog.json`). */
|
|
37
|
+
catalog: () => Effect.Effect<Catalog, ModelsDevError, never>;
|
|
38
|
+
}>;
|
|
39
|
+
/** Service key for dependency-injecting a shared client: `yield* Models.Service`. */
|
|
40
|
+
export declare class Service extends Service_base {
|
|
41
|
+
}
|
|
42
|
+
/** Layer providing `Models.Service`; requires an `HttpClient` in the environment. */
|
|
43
|
+
export declare const layer: (options?: ClientOptions) => Layer.Layer<Service, never, HttpClient.HttpClient>;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/effect/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvD,OAAO,EAAE,UAAU,EAAsB,MAAM,sBAAsB,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;;;;AAEzE,kHAAkH;AAClH,qBAAa,cAAe,SAAQ,mBAElC;CAAG;AAEL,MAAM,WAAW,aAAa;IAC5B,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC1C;AAED;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,UAAU,aAAa;IAmBtC,0EAA0E;;IAE1E,yDAAyD;;IAEzD,0EAA0E;;gCAG5E,CAAA;AAEJ,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC,CAAA;;IAT5D,0EAA0E;;IAE1E,yDAAyD;;IAEzD,0EAA0E;;;AAOhF,qFAAqF;AACrF,qBAAa,OAAQ,SAAQ,YAAsE;CAAG;AAEtG,qFAAqF;AACrF,eAAO,MAAM,KAAK,GAAI,UAAU,aAAa,uDAAyC,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
2
|
+
import { HttpClient, HttpClientResponse } from "effect/unstable/http";
|
|
3
|
+
/** The only error in the failure channel of client methods. Wraps the underlying `HttpClientError` as `cause`. */
|
|
4
|
+
export class ModelsDevError extends Schema.TaggedErrorClass()("ModelsDevError", {
|
|
5
|
+
cause: Schema.Defect(),
|
|
6
|
+
}) {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Creates a stateless models.dev client on top of the `HttpClient` service
|
|
10
|
+
* from the environment (`FetchHttpClient.layer`, `NodeHttpClient.layer`, or a
|
|
11
|
+
* custom transport). Nothing is ever cached — compose `Effect.cached` /
|
|
12
|
+
* `Effect.cachedWithTTL` around calls for caching.
|
|
13
|
+
*/
|
|
14
|
+
export const make = (options) => Effect.gen(function* () {
|
|
15
|
+
const http = yield* HttpClient.HttpClient;
|
|
16
|
+
const baseUrl = options?.baseUrl ?? "https://models.dev";
|
|
17
|
+
const base = baseUrl.endsWith("/") ? baseUrl : baseUrl + "/";
|
|
18
|
+
const get = (path) => http
|
|
19
|
+
.get(new URL(path, base), {
|
|
20
|
+
headers: options?.headers,
|
|
21
|
+
})
|
|
22
|
+
.pipe(Effect.flatMap(HttpClientResponse.filterStatusOk), Effect.flatMap((response) => response.json), Effect.map((data) => data), Effect.mapError((cause) => new ModelsDevError({ cause })));
|
|
23
|
+
return {
|
|
24
|
+
/** All providers with their models, pricing, and limits (`/api.json`). */
|
|
25
|
+
providers: () => get("api.json"),
|
|
26
|
+
/** Provider-agnostic model metadata (`/models.json`). */
|
|
27
|
+
models: () => get("models.json"),
|
|
28
|
+
/** Providers and model metadata in a single request (`/catalog.json`). */
|
|
29
|
+
catalog: () => get("catalog.json"),
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
/** Service key for dependency-injecting a shared client: `yield* Models.Service`. */
|
|
33
|
+
export class Service extends Context.Service()("@opencode-ai/models/Models") {
|
|
34
|
+
}
|
|
35
|
+
/** Layer providing `Models.Service`; requires an `HttpClient` in the environment. */
|
|
36
|
+
export const layer = (options) => Layer.effect(Service)(make(options));
|
|
37
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/effect/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAGrE,kHAAkH;AAClH,MAAM,OAAO,cAAe,SAAQ,MAAM,CAAC,gBAAgB,EAAkB,CAAC,gBAAgB,EAAE;IAC9F,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;CACvB,CAAC;CAAG;AASL;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,OAAuB,EAAE,EAAE,CAC9C,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MA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,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA"}
|
package/dist/effect.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effect.d.ts","sourceRoot":"","sources":["../src/effect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC1F,mBAAmB,YAAY,CAAA"}
|
package/dist/effect.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effect.js","sourceRoot":"","sources":["../src/effect.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAyC,MAAM,oBAAoB,CAAA"}
|
package/dist/error.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type ModelsDevErrorReason = "Transport" | "UnexpectedStatus" | "MalformedResponse";
|
|
2
|
+
/**
|
|
3
|
+
* The only error thrown by the models.dev client.
|
|
4
|
+
*
|
|
5
|
+
* - `Transport` — the fetch itself failed (network, DNS, abort). `cause` is the underlying error.
|
|
6
|
+
* - `UnexpectedStatus` — non-2xx response. `cause` is `{ status: number }`.
|
|
7
|
+
* - `MalformedResponse` — the body was empty or not valid JSON. `cause` is the parse error, if any.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ModelsDevError extends Error {
|
|
10
|
+
readonly reason: ModelsDevErrorReason;
|
|
11
|
+
readonly name = "ModelsDevError";
|
|
12
|
+
constructor(reason: ModelsDevErrorReason, options?: ErrorOptions);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG,kBAAkB,GAAG,mBAAmB,CAAA;AAEzF;;;;;;GAMG;AACH,qBAAa,cAAe,SAAQ,KAAK;IAGrC,QAAQ,CAAC,MAAM,EAAE,oBAAoB;IAFvC,SAAkB,IAAI,oBAAmB;gBAE9B,MAAM,EAAE,oBAAoB,EACrC,OAAO,CAAC,EAAE,YAAY;CAIzB"}
|
package/dist/error.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The only error thrown by the models.dev client.
|
|
3
|
+
*
|
|
4
|
+
* - `Transport` — the fetch itself failed (network, DNS, abort). `cause` is the underlying error.
|
|
5
|
+
* - `UnexpectedStatus` — non-2xx response. `cause` is `{ status: number }`.
|
|
6
|
+
* - `MalformedResponse` — the body was empty or not valid JSON. `cause` is the parse error, if any.
|
|
7
|
+
*/
|
|
8
|
+
export class ModelsDevError extends Error {
|
|
9
|
+
reason;
|
|
10
|
+
name = "ModelsDevError";
|
|
11
|
+
constructor(reason, options) {
|
|
12
|
+
super(reason, options);
|
|
13
|
+
this.reason = reason;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IAG5B;IAFO,IAAI,GAAG,gBAAgB,CAAA;IACzC,YACW,MAA4B,EACrC,OAAsB;QAEtB,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QAHb,WAAM,GAAN,MAAM,CAAsB;IAIvC,CAAC;CACF"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Model family identifiers used to group related models. */
|
|
2
|
+
export type ModelFamily = "Hy" | "agi" | "allam" | "allenai" | "alpha" | "aura" | "auto" | "baichuan" | "bart" | "bge" | "big-pickle" | "canopylabs" | "chutesai" | "claude" | "claude-fable" | "claude-haiku" | "claude-opus" | "claude-sonnet" | "codestral" | "codestral-embed" | "cogito" | "cohere-embed" | "command" | "command-a" | "command-light" | "command-r" | "dall-e" | "deepseek" | "deepseek-flash" | "deepseek-flash-free" | "deepseek-flash-think" | "deepseek-thinking" | "devstral" | "discolm" | "distilbert" | "dream-machine" | "dreamshaper" | "elephant" | "elevenlabs" | "ernie" | "falcon" | "flux" | "fugu" | "gemini" | "gemini-embedding" | "gemini-flash" | "gemini-flash-lite" | "gemini-pro" | "gemma" | "glm" | "glm-air" | "glm-flash" | "glm-free" | "glm-z" | "glmv" | "gpt" | "gpt-codex" | "gpt-codex-mini" | "gpt-codex-spark" | "gpt-image" | "gpt-mini" | "gpt-nano" | "gpt-oss" | "gpt-pro" | "granite" | "grok" | "grok-beta" | "grok-build" | "grok-vision" | "groq" | "hermes" | "hunyuan" | "hy3" | "hy3-free" | "ideogram" | "imagen" | "indictrans" | "intellect" | "jais" | "jamba" | "kat-coder" | "kimi" | "kimi-free" | "kimi-k2" | "kimi-thinking" | "ling" | "ling-flash-free" | "liquid" | "llama" | "llava" | "longcat" | "lucid" | "lyria" | "m2m" | "magistral" | "magistral-medium" | "magistral-small" | "mai" | "melotts" | "mercury" | "mimo" | "mimo-flash-free" | "mimo-omni" | "mimo-omni-free" | "mimo-pro" | "mimo-pro-free" | "mimo-v2-omni" | "mimo-v2-pro" | "mimo-v2.5" | "mimo-v2.5-free" | "mimo-v2.5-pro" | "minimax" | "minimax-free" | "minimax-m2.5" | "minimax-m2.7" | "minimax-m3" | "minimax-m3-free" | "ministral" | "mistral" | "mistral-embed" | "mistral-large" | "mistral-medium" | "mistral-nemo" | "mistral-small" | "mixtral" | "mm-poly" | "model-router" | "morph" | "nano-banana" | "nemoretriever" | "nemotron" | "nemotron-free" | "neural-chat" | "north" | "north-free" | "nousresearch" | "nova" | "nova-lite" | "nova-micro" | "nova-pro" | "o" | "o-mini" | "o-pro" | "openchat" | "opengvlab" | "ornith" | "osmosis" | "oswe" | "palmyra" | "pangu" | "parakeet" | "phi" | "phoenix" | "pixtral" | "plamo" | "pony" | "qvq" | "qwen" | "qwen-free" | "qwen3.5" | "qwen3.6" | "qwen3.7-max" | "qwen3.7-plus" | "qwerky" | "ray" | "recraft" | "rednote" | "reka" | "resnet" | "ring" | "ring-1t-free" | "rnj" | "runway" | "sarvam" | "seed" | "sherlock" | "skywork" | "smart-turn" | "solar" | "solar-mini" | "solar-pro" | "sonar" | "sonar-deep-research" | "sonar-pro" | "sonar-reasoning" | "sora" | "sourceful" | "sqlcoder" | "stable-diffusion" | "starling" | "step" | "tako" | "text-embedding" | "titan" | "titan-embed" | "tngtech" | "topazlabs" | "trinity" | "trinity-mini" | "tstars" | "una-cybertron" | "unsloth" | "v0" | "venice" | "veo" | "voxtral" | "voyage" | "whisper" | "yi" | "zephyr";
|
|
3
|
+
//# sourceMappingURL=generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated.d.ts","sourceRoot":"","sources":["../src/generated.ts"],"names":[],"mappings":"AAEA,6DAA6D;AAC7D,MAAM,MAAM,WAAW,GACnB,IAAI,GACJ,KAAK,GACL,OAAO,GACP,SAAS,GACT,OAAO,GACP,MAAM,GACN,MAAM,GACN,UAAU,GACV,MAAM,GACN,KAAK,GACL,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,cAAc,GACd,cAAc,GACd,aAAa,GACb,eAAe,GACf,WAAW,GACX,iBAAiB,GACjB,QAAQ,GACR,cAAc,GACd,SAAS,GACT,WAAW,GACX,eAAe,GACf,WAAW,GACX,QAAQ,GACR,UAAU,GACV,gBAAgB,GAChB,qBAAqB,GACrB,sBAAsB,GACtB,mBAAmB,GACnB,UAAU,GACV,SAAS,GACT,YAAY,GACZ,eAAe,GACf,aAAa,GACb,UAAU,GACV,YAAY,GACZ,OAAO,GACP,QAAQ,GACR,MAAM,GACN,MAAM,G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AAK,GACL,SAAS,GACT,SAAS,GACT,OAAO,GACP,MAAM,GACN,KAAK,GACL,MAAM,GACN,WAAW,GACX,SAAS,GACT,SAAS,GACT,aAAa,GACb,cAAc,GACd,QAAQ,GACR,KAAK,GACL,SAAS,GACT,SAAS,GACT,MAAM,GACN,QAAQ,GACR,MAAM,GACN,cAAc,GACd,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,UAAU,GACV,SAAS,GACT,YAAY,GACZ,OAAO,GACP,YAAY,GACZ,WAAW,GACX,OAAO,GACP,qBAAqB,GACrB,WAAW,GACX,iBAAiB,GACjB,MAAM,GACN,WAAW,GACX,UAAU,GACV,kBAAkB,GAClB,UAAU,GACV,MAAM,GACN,MAAM,GACN,gBAAgB,GAChB,OAAO,GACP,aAAa,GACb,SAAS,GACT,WAAW,GACX,SAAS,GACT,cAAc,GACd,QAAQ,GACR,eAAe,GACf,SAAS,GACT,IAAI,GACJ,QAAQ,GACR,KAAK,GACL,SAAS,GACT,QAAQ,GACR,SAAS,GACT,IAAI,GACJ,QAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated.js","sourceRoot":"","sources":["../src/generated.ts"],"names":[],"mappings":"AAAA,wFAAwF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * as Models from "./client.js";
|
|
2
|
+
export type { ClientOptions, HeadersInput, ModelsClient, RequestOptions } from "./client.js";
|
|
3
|
+
export { ModelsDevError, type ModelsDevErrorReason } from "./error.js";
|
|
4
|
+
export type * from "./types.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5F,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACtE,mBAAmB,YAAY,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAErC,OAAO,EAAE,cAAc,EAA6B,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Catalog, ModelMetadataMap, ProviderMap } from "./index.js"
|
|
2
|
+
|
|
3
|
+
/** All providers with their models, pricing, and limits. Same shape as `client.providers()`. */
|
|
4
|
+
export declare const providers: ProviderMap
|
|
5
|
+
|
|
6
|
+
/** Provider-agnostic model metadata keyed by canonical model ID. Same shape as `client.models()`. */
|
|
7
|
+
export declare const models: ModelMetadataMap
|
|
8
|
+
|
|
9
|
+
/** ISO timestamp of when this snapshot was generated from the models.dev repository. */
|
|
10
|
+
export declare const generatedAt: string
|
|
11
|
+
|
|
12
|
+
/** The full catalog: `{ providers, models }`. Same shape as `client.catalog()`. */
|
|
13
|
+
declare const snapshot: Catalog
|
|
14
|
+
export default snapshot
|