@apertis/ai-sdk-provider 2.1.0 → 3.0.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/README.md +49 -27
- package/dist/index.cjs +2137 -327
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2137 -327
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -4,8 +4,9 @@ Apertis AI provider for the [Vercel AI SDK](https://sdk.vercel.ai/).
|
|
|
4
4
|
|
|
5
5
|
## Compatibility
|
|
6
6
|
|
|
7
|
-
- **
|
|
7
|
+
- **AI SDK 5.0+** - Compatible with both AI SDK v5 and v6
|
|
8
8
|
- **Node.js 18+** - Minimum supported Node.js version
|
|
9
|
+
- **OpenCode, Kilo Code, Cursor** - Works with all AI coding tools built on the Vercel AI SDK
|
|
9
10
|
|
|
10
11
|
## Installation
|
|
11
12
|
|
|
@@ -49,8 +50,8 @@ const { text } = await generateText({
|
|
|
49
50
|
import { apertis } from '@apertis/ai-sdk-provider';
|
|
50
51
|
import { streamText } from 'ai';
|
|
51
52
|
|
|
52
|
-
const { textStream } =
|
|
53
|
-
model: apertis('claude-sonnet-4
|
|
53
|
+
const { textStream } = streamText({
|
|
54
|
+
model: apertis('claude-sonnet-4-6'),
|
|
54
55
|
prompt: 'Write a haiku about programming.',
|
|
55
56
|
});
|
|
56
57
|
|
|
@@ -81,8 +82,6 @@ const { text } = await generateText({
|
|
|
81
82
|
|
|
82
83
|
### Embeddings
|
|
83
84
|
|
|
84
|
-
Generate vector embeddings for semantic search and similarity:
|
|
85
|
-
|
|
86
85
|
```typescript
|
|
87
86
|
import { apertis } from '@apertis/ai-sdk-provider';
|
|
88
87
|
import { embed, embedMany } from 'ai';
|
|
@@ -95,26 +94,23 @@ const { embedding } = await embed({
|
|
|
95
94
|
|
|
96
95
|
// Multiple embeddings
|
|
97
96
|
const { embeddings } = await embedMany({
|
|
98
|
-
model: apertis.textEmbeddingModel('text-embedding-3-large',
|
|
99
|
-
dimensions: 1024, // Optional: reduce dimensions
|
|
100
|
-
}),
|
|
97
|
+
model: apertis.textEmbeddingModel('text-embedding-3-large'),
|
|
101
98
|
values: ['Hello', 'World'],
|
|
102
99
|
});
|
|
103
100
|
```
|
|
104
101
|
|
|
105
102
|
## Supported Models
|
|
106
103
|
|
|
107
|
-
Any model available on Apertis AI, including:
|
|
104
|
+
Any model available on [Apertis AI](https://apertis.ai), including:
|
|
108
105
|
|
|
109
106
|
### Chat Models
|
|
110
|
-
- **OpenAI**: `gpt-5.2`, `gpt-5.
|
|
111
|
-
- **Anthropic**: `claude-opus-4-
|
|
112
|
-
- **Google**: `gemini-3-pro-preview`, `gemini-3-flash-preview`, `gemini-2.5-
|
|
113
|
-
- **Other**: `glm-4.7`, `minimax-m2.1`, and
|
|
107
|
+
- **OpenAI**: `gpt-5.2`, `gpt-5.1`, `gpt-5.1-codex-mini`
|
|
108
|
+
- **Anthropic**: `claude-opus-4-6`, `claude-sonnet-4-6`, `claude-haiku-4.5`
|
|
109
|
+
- **Google**: `gemini-3-pro-preview`, `gemini-3-flash-preview`, `gemini-2.5-flash-preview`
|
|
110
|
+
- **Other**: `glm-4.7`, `minimax-m2.1`, and 500+ more models
|
|
114
111
|
|
|
115
112
|
### Embedding Models
|
|
116
113
|
- `text-embedding-3-small`, `text-embedding-3-large`
|
|
117
|
-
- `text-embedding-ada-002`
|
|
118
114
|
|
|
119
115
|
## Provider Configuration
|
|
120
116
|
|
|
@@ -122,25 +118,51 @@ Any model available on Apertis AI, including:
|
|
|
122
118
|
import { createApertis } from '@apertis/ai-sdk-provider';
|
|
123
119
|
|
|
124
120
|
const apertis = createApertis({
|
|
125
|
-
apiKey: 'sk-your-api-key',
|
|
126
|
-
baseURL: 'https://api.apertis.ai/v1',
|
|
127
|
-
headers: { 'X-Custom': 'value' },
|
|
121
|
+
apiKey: 'sk-your-api-key', // Optional if APERTIS_API_KEY is set
|
|
122
|
+
baseURL: 'https://api.apertis.ai/v1', // Custom API endpoint
|
|
123
|
+
headers: { 'X-Custom': 'value' }, // Custom headers
|
|
128
124
|
});
|
|
129
125
|
```
|
|
130
126
|
|
|
131
|
-
|
|
127
|
+
### Use with OpenCode
|
|
128
|
+
|
|
129
|
+
Add to your `opencode.json`:
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"provider": {
|
|
134
|
+
"apertis": {
|
|
135
|
+
"npm": "@apertis/ai-sdk-provider",
|
|
136
|
+
"options": {
|
|
137
|
+
"apiKey": "sk-your-api-key"
|
|
138
|
+
},
|
|
139
|
+
"models": {
|
|
140
|
+
"claude-opus-4-6": { "name": "Claude Opus 4.6" },
|
|
141
|
+
"claude-sonnet-4-6": { "name": "Claude Sonnet 4.6" }
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Changelog
|
|
149
|
+
|
|
150
|
+
### v2.1.0
|
|
151
|
+
|
|
152
|
+
- Rewrite as thin wrapper over `@ai-sdk/openai-compatible` for guaranteed compatibility
|
|
153
|
+
- Works with AI SDK v5+ (OpenCode, Kilo Code, and all compatible tools)
|
|
154
|
+
- Simplified codebase (removed custom V2/V3 implementations)
|
|
155
|
+
|
|
156
|
+
### v2.0.x
|
|
132
157
|
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
158
|
+
- Default provider switched from V3 to V2 spec for broader compatibility
|
|
159
|
+
- Added V2 chat and embedding model implementations
|
|
160
|
+
- Fixed Zod parsing errors (`expected string, received object`) with OpenCode
|
|
136
161
|
|
|
137
|
-
|
|
162
|
+
### v1.x
|
|
138
163
|
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
- **Content format** - Output uses `content` array instead of separate `text`/`toolCalls`
|
|
142
|
-
- **Usage format** - Token tracking uses new `inputTokens`/`outputTokens` structure
|
|
143
|
-
- **Supported URLs** - New `supportedUrls` property for image URL support
|
|
164
|
+
- Custom `LanguageModelV3` implementation (requires AI SDK 6+)
|
|
165
|
+
- Custom streaming, tool calling, and embedding support
|
|
144
166
|
|
|
145
167
|
## License
|
|
146
168
|
|