aimodels 0.1.0

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Dmitry Kury
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,78 @@
1
+ # AIModels
2
+
3
+ A collection of AI model specifications across different providers. This package provides normalized data about AI models, including their capabilities, context windows, and pricing information.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install aimodels
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { models } from 'aimodels';
15
+
16
+ // Get all available models
17
+ console.log(models.all);
18
+
19
+ // Get list of all providers
20
+ console.log(models.providers); // ['openai', 'anthropic', 'meta', ...]
21
+
22
+ // Get models from a specific provider
23
+ const openAiModels = models.from('openai');
24
+
25
+ // Find a specific model
26
+ const model = models.find('deepseek-r1');
27
+ console.log(model.contextWindow);
28
+ console.log(model.providers);
29
+ console.log(model.pricing.input);
30
+
31
+ // Filter models by capability
32
+ const chatModels = models.withCapability('chat');
33
+
34
+ // Filter by context window
35
+ const largeContextModels = models.withMinContext(32768);
36
+
37
+ // Filter by maximum price
38
+ const affordableModels = models.withMaxPrice(0.01); // Max $0.01 per 1K tokens
39
+ ```
40
+
41
+ ## Data Structure
42
+
43
+ Each model entry contains the following information:
44
+
45
+ ```typescript
46
+ interface ModelSpec {
47
+ id: string; // Unique identifier for the model
48
+ name: string; // Display name
49
+ provider: string; // Provider (e.g., 'openai', 'anthropic', etc.)
50
+ contextWindow: number; // Maximum context window size in tokens
51
+ capabilities: string[]; // Array of capabilities (e.g., ['chat', 'completion'])
52
+ pricing: {
53
+ input: number; // Cost per 1K input tokens in USD
54
+ output: number; // Cost per 1K output tokens in USD
55
+ };
56
+ released: string; // Release date
57
+ license?: string; // License information for open-source models
58
+ trainingData?: string[]; // Known training data sources
59
+ parameters?: number; // Number of parameters (if known)
60
+ }
61
+ ```
62
+
63
+ ## Features
64
+
65
+ - Comprehensive database of AI models
66
+ - Normalized data structure for easy comparison
67
+ - Regular updates with new models
68
+ - TypeScript support
69
+ - Zero dependencies
70
+ - Universal JavaScript support (Node.js, browsers, Deno)
71
+
72
+ ## Contributing
73
+
74
+ Contributions are welcome! Please check our contributing guidelines for details on how to submit new models or updates.
75
+
76
+ ## License
77
+
78
+ MIT
@@ -0,0 +1,36 @@
1
+ interface ModelPricing {
2
+ input: number;
3
+ output: number;
4
+ }
5
+ interface ModelSpec {
6
+ id: string;
7
+ name: string;
8
+ provider: string;
9
+ contextWindow: number;
10
+ capabilities: string[];
11
+ pricing: ModelPricing;
12
+ released: string;
13
+ license?: string;
14
+ trainingData?: string[];
15
+ parameters?: number;
16
+ }
17
+ interface ModelsCollection {
18
+ /** All available models */
19
+ all: ModelSpec[];
20
+ /** List of all unique providers */
21
+ providers: string[];
22
+ /** Get models from a specific provider */
23
+ from(provider: string): ModelSpec[];
24
+ /** Find a specific model by ID */
25
+ find(id: string): ModelSpec | undefined;
26
+ /** Filter models by capability */
27
+ withCapability(capability: string): ModelSpec[];
28
+ /** Filter models by minimum context window */
29
+ withMinContext(tokens: number): ModelSpec[];
30
+ /** Filter models by maximum price (per 1K tokens) */
31
+ withMaxPrice(price: number): ModelSpec[];
32
+ }
33
+
34
+ declare const models: ModelsCollection;
35
+
36
+ export { type ModelPricing, type ModelSpec, type ModelsCollection, models };
@@ -0,0 +1,36 @@
1
+ interface ModelPricing {
2
+ input: number;
3
+ output: number;
4
+ }
5
+ interface ModelSpec {
6
+ id: string;
7
+ name: string;
8
+ provider: string;
9
+ contextWindow: number;
10
+ capabilities: string[];
11
+ pricing: ModelPricing;
12
+ released: string;
13
+ license?: string;
14
+ trainingData?: string[];
15
+ parameters?: number;
16
+ }
17
+ interface ModelsCollection {
18
+ /** All available models */
19
+ all: ModelSpec[];
20
+ /** List of all unique providers */
21
+ providers: string[];
22
+ /** Get models from a specific provider */
23
+ from(provider: string): ModelSpec[];
24
+ /** Find a specific model by ID */
25
+ find(id: string): ModelSpec | undefined;
26
+ /** Filter models by capability */
27
+ withCapability(capability: string): ModelSpec[];
28
+ /** Filter models by minimum context window */
29
+ withMinContext(tokens: number): ModelSpec[];
30
+ /** Filter models by maximum price (per 1K tokens) */
31
+ withMaxPrice(price: number): ModelSpec[];
32
+ }
33
+
34
+ declare const models: ModelsCollection;
35
+
36
+ export { type ModelPricing, type ModelSpec, type ModelsCollection, models };
package/dist/index.js ADDED
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ models: () => models
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+
27
+ // src/data/models.json
28
+ var models_default = [
29
+ {
30
+ id: "gpt-4",
31
+ name: "GPT-4",
32
+ provider: "openai",
33
+ contextWindow: 8192,
34
+ capabilities: ["chat", "completion"],
35
+ pricing: {
36
+ input: 0.03,
37
+ output: 0.06
38
+ },
39
+ released: "2023-03-14",
40
+ parameters: 11e11
41
+ },
42
+ {
43
+ id: "gpt-3.5-turbo",
44
+ name: "GPT-3.5 Turbo",
45
+ provider: "openai",
46
+ contextWindow: 4096,
47
+ capabilities: ["chat", "completion"],
48
+ pricing: {
49
+ input: 15e-4,
50
+ output: 2e-3
51
+ },
52
+ released: "2022-11-30"
53
+ },
54
+ {
55
+ id: "claude-2.1",
56
+ name: "Claude 2.1",
57
+ provider: "anthropic",
58
+ contextWindow: 2e5,
59
+ capabilities: ["chat", "completion"],
60
+ pricing: {
61
+ input: 8e-3,
62
+ output: 0.024
63
+ },
64
+ released: "2023-11-21"
65
+ },
66
+ {
67
+ id: "llama-2-70b",
68
+ name: "Llama 2 70B",
69
+ provider: "meta",
70
+ contextWindow: 4096,
71
+ capabilities: ["chat", "completion"],
72
+ pricing: {
73
+ input: 0,
74
+ output: 0
75
+ },
76
+ released: "2023-07-18",
77
+ license: "Llama 2 Community License",
78
+ parameters: 7e10
79
+ }
80
+ ];
81
+
82
+ // src/index.ts
83
+ var aimodels = models_default;
84
+ var models = {
85
+ all: aimodels,
86
+ get providers() {
87
+ return [...new Set(aimodels.map((model) => model.provider))];
88
+ },
89
+ from(provider) {
90
+ return aimodels.filter((model) => model.provider === provider);
91
+ },
92
+ find(id) {
93
+ return aimodels.find((model) => model.id === id);
94
+ },
95
+ withCapability(capability) {
96
+ return aimodels.filter((model) => model.capabilities.includes(capability));
97
+ },
98
+ withMinContext(tokens) {
99
+ return aimodels.filter((model) => model.contextWindow >= tokens);
100
+ },
101
+ withMaxPrice(price) {
102
+ return aimodels.filter(
103
+ (model) => model.pricing.input <= price && model.pricing.output <= price
104
+ );
105
+ }
106
+ };
107
+ // Annotate the CommonJS export names for ESM import in node:
108
+ 0 && (module.exports = {
109
+ models
110
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,83 @@
1
+ // src/data/models.json
2
+ var models_default = [
3
+ {
4
+ id: "gpt-4",
5
+ name: "GPT-4",
6
+ provider: "openai",
7
+ contextWindow: 8192,
8
+ capabilities: ["chat", "completion"],
9
+ pricing: {
10
+ input: 0.03,
11
+ output: 0.06
12
+ },
13
+ released: "2023-03-14",
14
+ parameters: 11e11
15
+ },
16
+ {
17
+ id: "gpt-3.5-turbo",
18
+ name: "GPT-3.5 Turbo",
19
+ provider: "openai",
20
+ contextWindow: 4096,
21
+ capabilities: ["chat", "completion"],
22
+ pricing: {
23
+ input: 15e-4,
24
+ output: 2e-3
25
+ },
26
+ released: "2022-11-30"
27
+ },
28
+ {
29
+ id: "claude-2.1",
30
+ name: "Claude 2.1",
31
+ provider: "anthropic",
32
+ contextWindow: 2e5,
33
+ capabilities: ["chat", "completion"],
34
+ pricing: {
35
+ input: 8e-3,
36
+ output: 0.024
37
+ },
38
+ released: "2023-11-21"
39
+ },
40
+ {
41
+ id: "llama-2-70b",
42
+ name: "Llama 2 70B",
43
+ provider: "meta",
44
+ contextWindow: 4096,
45
+ capabilities: ["chat", "completion"],
46
+ pricing: {
47
+ input: 0,
48
+ output: 0
49
+ },
50
+ released: "2023-07-18",
51
+ license: "Llama 2 Community License",
52
+ parameters: 7e10
53
+ }
54
+ ];
55
+
56
+ // src/index.ts
57
+ var aimodels = models_default;
58
+ var models = {
59
+ all: aimodels,
60
+ get providers() {
61
+ return [...new Set(aimodels.map((model) => model.provider))];
62
+ },
63
+ from(provider) {
64
+ return aimodels.filter((model) => model.provider === provider);
65
+ },
66
+ find(id) {
67
+ return aimodels.find((model) => model.id === id);
68
+ },
69
+ withCapability(capability) {
70
+ return aimodels.filter((model) => model.capabilities.includes(capability));
71
+ },
72
+ withMinContext(tokens) {
73
+ return aimodels.filter((model) => model.contextWindow >= tokens);
74
+ },
75
+ withMaxPrice(price) {
76
+ return aimodels.filter(
77
+ (model) => model.pricing.input <= price && model.pricing.output <= price
78
+ );
79
+ }
80
+ };
81
+ export {
82
+ models
83
+ };
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "aimodels",
3
+ "version": "0.1.0",
4
+ "description": "A collection of AI model specifications across different providers",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsup src/index.ts --format cjs,esm --dts",
20
+ "test": "jest",
21
+ "typecheck": "tsc --noEmit",
22
+ "lint": "eslint src --ext .ts",
23
+ "prepublishOnly": "npm run build"
24
+ },
25
+ "keywords": [
26
+ "ai",
27
+ "models",
28
+ "llm",
29
+ "machine-learning",
30
+ "specifications",
31
+ "openai",
32
+ "anthropic",
33
+ "open-source"
34
+ ],
35
+ "author": "Dmitry Kury (d@dkury.com)",
36
+ "license": "MIT",
37
+ "devDependencies": {
38
+ "@types/node": "^20.0.0",
39
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
40
+ "@typescript-eslint/parser": "^6.0.0",
41
+ "eslint": "^8.0.0",
42
+ "jest": "^29.0.0",
43
+ "ts-jest": "^29.0.0",
44
+ "tsup": "^8.0.0",
45
+ "typescript": "^5.0.0"
46
+ }
47
+ }