Skip to content

Commit da109b6

Browse files
committed
feat: Model Updates
1 parent 181bde5 commit da109b6

File tree

6 files changed

+58
-22
lines changed

6 files changed

+58
-22
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Passing a more complex message object is just as simple. The same rules apply:
123123

124124
```javascript
125125
const message = {
126-
model: 'gpt-3.5-turbo',
126+
model: 'gpt-4o-mini',
127127
messages: [
128128
{ role: 'system', content: 'You are a helpful assistant.' },
129129
{ role: 'user', content: 'Explain the importance of low latency LLMs.' },

docs/models.md

+11-14
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const geminiResult = await LLMInterface.sendMessage("gemini", "Explain the impor
6363
Changing the aliases is easy:
6464

6565
```javascript
66-
LLMInterface.setModelAlias("openai", "default", "gpt-3.5-turbo");
66+
LLMInterface.setModelAlias("openai", "default", "gpt-4o-mini");
6767
```
6868

6969
## Model Alias Values
@@ -197,7 +197,7 @@ LLMInterface.setModelAlias("openai", "default", "gpt-3.5-turbo");
197197
- `default`: forefront/Mistral-7B-Instruct-v0.2-chatml
198198
- `large`: forefront/Mistral-7B-Instruct-v0.2-chatml
199199
- `small`: forefront/Mistral-7B-Instruct-v0.2-chatml
200-
- `agent`:
200+
- `agent`:
201201

202202

203203
![](https://samestrin.github.io/media/llm-interface/icons/blank.png)
@@ -318,7 +318,7 @@ LLMInterface.setModelAlias("openai", "default", "gpt-3.5-turbo");
318318
- `default`: Neets-7B
319319
- `large`: mistralai/Mixtral-8X7B-Instruct-v0.1
320320
- `small`: Neets-7B
321-
- `agent`:
321+
- `agent`:
322322

323323

324324
![](https://samestrin.github.io/media/llm-interface/icons/blank.png)
@@ -362,17 +362,15 @@ LLMInterface.setModelAlias("openai", "default", "gpt-3.5-turbo");
362362
- `default`: llama3
363363
- `large`: llama3
364364
- `small`: llama3
365-
- `agent`:
365+
- `agent`:
366366

367367

368368
![](https://samestrin.github.io/media/llm-interface/icons/blank.png)
369369
### [OpenAI](providers/openai.md)
370370

371-
372-
373-
- `default`: gpt-3.5-turbo
371+
- `default`: gpt-4o-mini
374372
- `large`: gpt-4o
375-
- `small`: gpt-3.5-turbo
373+
- `small`: gpt-4o-mini
376374
- `agent`: gpt-4o
377375

378376

@@ -381,10 +379,10 @@ LLMInterface.setModelAlias("openai", "default", "gpt-3.5-turbo");
381379

382380
![perplexity](https://samestrin.github.io/media/llm-interface/icons/perplexity.png)
383381

384-
- `default`: llama-3-sonar-large-32k-online
385-
- `large`: llama-3-sonar-large-32k-online
386-
- `small`: llama-3-sonar-small-32k-online
387-
- `agent`: llama-3-sonar-large-32k-online
382+
- `default`: llama-3.1-sonar-large-128k-chat
383+
- `large`: llama-3.1-sonar-large-128k-chat
384+
- `small`: llama-3.1-sonar-small-128k-chat
385+
- `agent`: llama-3.1-70b-instruct
388386

389387

390388
![](https://samestrin.github.io/media/llm-interface/icons/blank.png)
@@ -461,7 +459,7 @@ LLMInterface.setModelAlias("openai", "default", "gpt-3.5-turbo");
461459
- `default`: palmyra-x-002-32k
462460
- `large`: palmyra-x-002-32k
463461
- `small`: palmyra-x-002-32k
464-
- `agent`:
462+
- `agent`:
465463

466464

467465
![](https://samestrin.github.io/media/llm-interface/icons/blank.png)
@@ -473,4 +471,3 @@ LLMInterface.setModelAlias("openai", "default", "gpt-3.5-turbo");
473471
- `large`: glm-4
474472
- `small`: glm-4-flash
475473
- `agent`: glm-4
476-

docs/providers/perplexity.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ main();
3030

3131
### Model Aliases
3232

33-
The following model aliases are provided for this provider.
33+
The following model aliases are provided for this provider.
3434

35-
- `default`: llama-3-sonar-large-32k-online
36-
- `large`: llama-3-sonar-large-32k-online
37-
- `small`: llama-3-sonar-small-32k-online
38-
- `agent`: llama-3-sonar-large-32k-online
35+
- `default`: llama-3.1-sonar-large-128k-chat
36+
- `large`: llama-3.1-sonar-large-128k-chat
37+
- `small`: llama-3.1-sonar-small-128k-chat
38+
- `agent`: llama-3.1-8b-instruct
3939

4040

4141
## Options

src/config/providers/openai.json

+20-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1-
{"url":"https://api.openai.com/v1/chat/completions","model":{"default":"gpt-3.5-turbo","large":"gpt-4o","small":"gpt-3.5-turbo","agent":"gpt-4o"},"embeddingUrl":"https://api.openai.com/v1/embeddings","embeddings":{"default":"text-embedding-ada-002","large":"text-embedding-3-large","small":"text-embedding-3-small"},"createMessageObject":"getMessageObject","stream":true,"jsonMode":true,"maxTokens":true,"hasEmbeddings":true}
1+
{
2+
"url": "https://api.openai.com/v1/chat/completions",
3+
"model": {
4+
"default": "gpt-4o-mini",
5+
"large": "gpt-4o",
6+
"small": "gpt-4o-mini",
7+
"agent": "gpt-4o"
8+
},
9+
"embeddingUrl": "https://api.openai.com/v1/embeddings",
10+
"embeddings": {
11+
"default": "text-embedding-ada-002",
12+
"large": "text-embedding-3-large",
13+
"small": "text-embedding-3-small"
14+
},
15+
"createMessageObject": "getMessageObject",
16+
"stream": true,
17+
"jsonMode": true,
18+
"maxTokens": true,
19+
"hasEmbeddings": true
20+
}

src/config/providers/perplexity.json

+14-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
{"url":"https://api.perplexity.ai/chat/completions","model":{"default":"llama-3-sonar-large-32k-online","large":"llama-3-sonar-large-32k-online","small":"llama-3-sonar-small-32k-online","agent":"llama-3-sonar-large-32k-online"},"createMessageObject":"getMessageObject","stream":true,"jsonMode":false,"maxTokens":true,"hasEmbeddings":false}
1+
{
2+
"url": "https://api.perplexity.ai/chat/completions",
3+
"model": {
4+
"default": "llama-3.1-sonar-large-128k-chat",
5+
"large": "llama-3.1-sonar-large-128k-chat",
6+
"small": "llama-3.1-sonar-small-128k-chat",
7+
"agent": "llama-3.1-70b-instruct"
8+
},
9+
"createMessageObject": "getMessageObject",
10+
"stream": true,
11+
"jsonMode": false,
12+
"maxTokens": true,
13+
"hasEmbeddings": false
14+
}

src/utils/retryWithBackoff.js

+7
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,16 @@ async function retryWithBackoff(fn, options, errorType) {
2626
let response = await fn();
2727
if (response?.results) {
2828
const end = hrtime(start);
29+
const resultsEnd = hrtime(start);
30+
2931
const milliseconds = end[0] * 1e3 + end[1] / 1e6;
3032
response.total_time = milliseconds.toFixed(5);
33+
34+
const resultsMilliseconds = resultsEnd[0] * 1e3 + resultsEnd[1] / 1e6;
35+
response.request_time = resultsMilliseconds.toFixed(5);
36+
3137
response.retries = currentRetry;
38+
3239
return response;
3340
}
3441
} catch (error) {

0 commit comments

Comments
 (0)