aimodels 0.1.0 → 0.1.2

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/README.md CHANGED
@@ -38,28 +38,6 @@ const largeContextModels = models.withMinContext(32768);
38
38
  const affordableModels = models.withMaxPrice(0.01); // Max $0.01 per 1K tokens
39
39
  ```
40
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
41
  ## Features
64
42
 
65
43
  - Comprehensive database of AI models
@@ -69,9 +47,6 @@ interface ModelSpec {
69
47
  - Zero dependencies
70
48
  - Universal JavaScript support (Node.js, browsers, Deno)
71
49
 
72
- ## Contributing
73
-
74
- Contributions are welcome! Please check our contributing guidelines for details on how to submit new models or updates.
75
50
 
76
51
  ## License
77
52
 
package/dist/index.d.mts CHANGED
@@ -1,36 +1,75 @@
1
- interface ModelPricing {
1
+ interface ModelPrice {
2
+ /** Price per million input tokens */
2
3
  input: number;
4
+ /** Price per million output tokens */
3
5
  output: number;
6
+ /** Price type */
7
+ type: 'token';
4
8
  }
5
- interface ModelSpec {
9
+
10
+ interface ModelContext {
11
+ /** Maximum total tokens (input + output) */
12
+ total: number;
13
+ /** Maximum output tokens */
14
+ maxOutput: number;
15
+ }
16
+ interface Model {
17
+ /** Unique identifier */
6
18
  id: string;
19
+ /** Display name */
7
20
  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;
21
+ /** License type (e.g., "proprietary", "apache-2.0", "llama-2-community") */
22
+ license: string;
23
+ /** List of providers that can serve this model */
24
+ providers: string[];
25
+ /** Model capabilities */
26
+ can: string[];
27
+ /** Context window information */
28
+ context: ModelContext;
16
29
  }
17
- interface ModelsCollection {
30
+ interface ModelCollection {
18
31
  /** All available models */
19
- all: ModelSpec[];
20
- /** List of all unique providers */
32
+ all: Model[];
33
+ /** List of all creators */
34
+ creators: string[];
35
+ /** List of all providers */
21
36
  providers: string[];
37
+ /** Get models from a specific creator */
38
+ fromCreator(creator: string): Model[];
22
39
  /** Get models from a specific provider */
23
- from(provider: string): ModelSpec[];
40
+ fromProvider(provider: string): Model[];
24
41
  /** Find a specific model by ID */
25
- find(id: string): ModelSpec | undefined;
26
- /** Filter models by capability */
27
- withCapability(capability: string): ModelSpec[];
42
+ find(id: string): Model | undefined;
43
+ /** Filter models by one or more capabilities (all must be present) */
44
+ can(...capabilities: string[]): Model[];
28
45
  /** 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[];
46
+ withMinContext(tokens: number): Model[];
47
+ /** Get pricing for a model from a specific provider */
48
+ getPrice(modelId: string, provider: string): ModelPrice | undefined;
32
49
  }
33
50
 
34
- declare const models: ModelsCollection;
51
+ var creators = {
52
+ openai: {
53
+ name: "OpenAI",
54
+ website: "https://openai.com"
55
+ },
56
+ anthropic: {
57
+ name: "Anthropic",
58
+ website: "https://anthropic.com"
59
+ },
60
+ meta: {
61
+ name: "Meta",
62
+ website: "https://ai.meta.com"
63
+ },
64
+ mistral: {
65
+ name: "Mistral AI",
66
+ website: "https://mistral.ai"
67
+ }
68
+ };
69
+ var creators$1 = {
70
+ creators: creators
71
+ };
72
+
73
+ declare const models: ModelCollection;
35
74
 
36
- export { type ModelPricing, type ModelSpec, type ModelsCollection, models };
75
+ export { creators$1 as creators, models };
package/dist/index.d.ts CHANGED
@@ -1,36 +1,75 @@
1
- interface ModelPricing {
1
+ interface ModelPrice {
2
+ /** Price per million input tokens */
2
3
  input: number;
4
+ /** Price per million output tokens */
3
5
  output: number;
6
+ /** Price type */
7
+ type: 'token';
4
8
  }
5
- interface ModelSpec {
9
+
10
+ interface ModelContext {
11
+ /** Maximum total tokens (input + output) */
12
+ total: number;
13
+ /** Maximum output tokens */
14
+ maxOutput: number;
15
+ }
16
+ interface Model {
17
+ /** Unique identifier */
6
18
  id: string;
19
+ /** Display name */
7
20
  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;
21
+ /** License type (e.g., "proprietary", "apache-2.0", "llama-2-community") */
22
+ license: string;
23
+ /** List of providers that can serve this model */
24
+ providers: string[];
25
+ /** Model capabilities */
26
+ can: string[];
27
+ /** Context window information */
28
+ context: ModelContext;
16
29
  }
17
- interface ModelsCollection {
30
+ interface ModelCollection {
18
31
  /** All available models */
19
- all: ModelSpec[];
20
- /** List of all unique providers */
32
+ all: Model[];
33
+ /** List of all creators */
34
+ creators: string[];
35
+ /** List of all providers */
21
36
  providers: string[];
37
+ /** Get models from a specific creator */
38
+ fromCreator(creator: string): Model[];
22
39
  /** Get models from a specific provider */
23
- from(provider: string): ModelSpec[];
40
+ fromProvider(provider: string): Model[];
24
41
  /** Find a specific model by ID */
25
- find(id: string): ModelSpec | undefined;
26
- /** Filter models by capability */
27
- withCapability(capability: string): ModelSpec[];
42
+ find(id: string): Model | undefined;
43
+ /** Filter models by one or more capabilities (all must be present) */
44
+ can(...capabilities: string[]): Model[];
28
45
  /** 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[];
46
+ withMinContext(tokens: number): Model[];
47
+ /** Get pricing for a model from a specific provider */
48
+ getPrice(modelId: string, provider: string): ModelPrice | undefined;
32
49
  }
33
50
 
34
- declare const models: ModelsCollection;
51
+ var creators = {
52
+ openai: {
53
+ name: "OpenAI",
54
+ website: "https://openai.com"
55
+ },
56
+ anthropic: {
57
+ name: "Anthropic",
58
+ website: "https://anthropic.com"
59
+ },
60
+ meta: {
61
+ name: "Meta",
62
+ website: "https://ai.meta.com"
63
+ },
64
+ mistral: {
65
+ name: "Mistral AI",
66
+ website: "https://mistral.ai"
67
+ }
68
+ };
69
+ var creators$1 = {
70
+ creators: creators
71
+ };
72
+
73
+ declare const models: ModelCollection;
35
74
 
36
- export { type ModelPricing, type ModelSpec, type ModelsCollection, models };
75
+ export { creators$1 as creators, models };