Skip to content

Commit f700635

Browse files
authored
fix: Merge pull request #28 from AI21Labs/update_model_names
feat: Update Model Names to Jamba-Mini and Jamba-Large
2 parents 272ccb3 + bfd71d0 commit f700635

File tree

8 files changed

+27
-9
lines changed

8 files changed

+27
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const client = new AI21({
8181
});
8282

8383
const response = await client.chat.completions.create({
84-
model: 'jamba-1.5-mini',
84+
model: 'jamba-mini',
8585
messages: [{ role: 'user', content: 'Hello, how are you? tell me a 100 line story about a cat named "Fluffy"' }],
8686
});
8787

@@ -96,7 +96,7 @@ The client supports streaming responses for real-time processing. Here are examp
9696

9797
```typescript
9898
const streamResponse = await client.chat.completions.create({
99-
model: 'jamba-1.5-mini',
99+
model: 'jamba-mini',
100100
messages: [{ role: 'user', content: 'Write a story about a space cat' }],
101101
stream: true,
102102
});

examples/studio/chat/chat-completions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ async function main() {
55

66
try {
77
const response = await client.chat.completions.create({
8-
model: 'jamba-1.5-mini',
8+
model: 'jamba-mini',
99
messages: [{ role: 'user', content: 'Hello, how are you? tell me a 100 line story about a cat' }],
1010
});
1111
console.log(response);

examples/studio/chat/chat-documents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async function main() {
2929

3030
try {
3131
const response = await client.chat.completions.create({
32-
model: 'jamba-1.5-mini',
32+
model: 'jamba-mini',
3333
messages: [
3434
{
3535
role: 'system',

examples/studio/chat/chat-response-format.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async function main() {
2222
try {
2323
const response = await client.chat.completions.create({
2424
messages,
25-
model: 'jamba-1.5-large',
25+
model: 'jamba-large',
2626
responseFormat,
2727
});
2828

examples/studio/chat/stream-chat-completions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ async function main() {
55

66
try {
77
const streamResponse = await client.chat.completions.create({
8-
model: 'jamba-1.5-mini',
8+
model: 'jamba-mini',
99
messages: [{ role: 'user', content: 'Hello, how are you? tell me a short story' }],
1010
stream: true,
1111
});

examples/studio/chat/tools-chat-completions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async function main() {
4242
try {
4343
// First response with streaming
4444
const response = await client.chat.completions.create({
45-
model: 'jamba-1.5-large',
45+
model: 'jamba-large',
4646
messages,
4747
tools,
4848
});
@@ -69,7 +69,7 @@ async function main() {
6969

7070
// Get final response
7171
const finalResponse = await client.chat.completions.create({
72-
model: 'jamba-1.5-large',
72+
model: 'jamba-large',
7373
messages,
7474
tools,
7575
});

src/resources/chat/completions.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import * as Models from '../../types';
22
import { APIResource } from '../../APIResource';
33
import { Stream } from '../../streaming';
44

5+
const deprecatedModels = ['jamba-1.5-mini', 'jamba-1.5-large'];
6+
57
export class Completions extends APIResource {
68
create(
79
body: Models.ChatCompletionCreateParamsNonStreaming,
@@ -19,6 +21,14 @@ export class Completions extends APIResource {
1921
): Promise<Stream<Models.ChatCompletionChunk> | Models.ChatCompletionResponse>;
2022

2123
create(body: Models.ChatCompletionCreateParams, options?: Models.RequestOptions) {
24+
// Check for deprecated models
25+
if (deprecatedModels.includes(body.model)) {
26+
console.warn(
27+
`Warning: The model "${body.model}" is deprecated and will be removed in a future release.
28+
Please use jamba-mini or jamba-large instead.`,
29+
);
30+
}
31+
2232
return this.client.post<Models.ChatCompletionCreateParams, Models.ChatCompletionResponse>(
2333
'/chat/completions',
2434
{

src/types/chat/ChatModel.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
export type ChatModel = 'jamba-1.5-mini' | 'jamba-1.5-large';
1+
export type ChatModel =
2+
| 'jamba-mini'
3+
| 'jamba-large'
4+
| 'jamba-large-1.6-2025-03'
5+
| 'jamba-mini-1.6-2025-03'
6+
| 'jamba-large-1.6'
7+
| 'jamba-mini-1.6'
8+
| 'jamba-1.5-mini'
9+
| 'jamba-1.5-large';

0 commit comments

Comments
 (0)