Skip to content

Commit d6f6096

Browse files
authored
docs: rearrange model provider doc (#705)
Signed-off-by: Grant Linville <[email protected]>
1 parent 24b1f24 commit d6f6096

File tree

1 file changed

+42
-28
lines changed

1 file changed

+42
-28
lines changed
Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,24 @@
11
# Supported Models and Platforms
22

3-
## Usage
4-
53
GPTScript can be used against alternative models that expose an OpenAI-compatible API or have a provider available.
4+
Here is an example using Claude:
65

7-
### Using a model with an OpenAI compatible API
8-
9-
```gptscript
10-
model: mistral-large-latest from https://api.mistral.ai/v1
11-
12-
Say hello world
13-
```
14-
15-
:::note
16-
Mistral's La Plateforme has an OpenAI-compatible API, but the model does not behave identically to gpt-4. For that reason, we also have a provider for it that might get better results in some cases.
17-
:::
18-
19-
### Using a model that requires a provider
206
```gptscript
217
model: claude-3-haiku-20240307 from github.com/gptscript-ai/claude3-anthropic-provider
228
239
Say hello world
2410
```
2511

26-
### Authentication
12+
A note on model compatibility:
2713

28-
For OpenAI compatible providers, GPTScript will look for an API key to be configured with the
29-
prefix `GPTSCRIPT_PROVIDER_`, the base domain converted to environment variable format, and a suffix of `_API_KEY`.
30-
For example, if you are using `mistral-large-latest from https://api.mistral.ai/v1`, the environment variable would
31-
be `GPTSCRIPT_PROVIDER_API_MISTRAL_AI_API_KEY`.
14+
:::important
15+
While the providers allow GPTScript to work with other models, the effectiveness of using a
16+
different model will depend on a combination of prompt engineering and the quality of the model. You may need to change
17+
wording or add more description if you are not getting the results you want. In some cases, the model might not be
18+
capable of intelligently handling the complex function calls.
19+
:::
20+
21+
## Authentication
3222

3323
Each provider has different requirements for authentication. Please check the readme for the provider you are
3424
trying to use.
@@ -50,16 +40,40 @@ The following providers are currently available:
5040
For any provider that supports listing models, you can use this command:
5141

5242
```bash
53-
# With a provider
5443
gptscript --list-models github.com/gptscript-ai/claude3-anthropic-provider
44+
```
5545

56-
# With an OpenAI-compatible endpoint
57-
gptscript --list-models https://api.mistral.ai/v1
46+
## OpenAI-Compatible APIs (Advanced)
47+
48+
:::warning
49+
Even if a non-OpenAI service has an API that claims to be OpenAI-compatible, there are usually subtle differences that cause things to break.
50+
The approach described in this section often does not work.
51+
:::
52+
53+
You can use a model from an OpenAI-compatible API like this:
54+
55+
```gptscript
56+
model: mistral-large-latest from https://api.mistral.ai/v1
57+
58+
Say hello world
5859
```
5960

60-
## Compatibility
61+
:::note
62+
Mistral's La Plateforme has an OpenAI-compatible API, but the model does not behave identically to gpt-4.
63+
For that reason, we also have a provider for it that might get better results in some cases.
64+
:::
6165

62-
While the providers allow GPTScript to work with other models, the effectiveness of using a
63-
different model will depend on a combination of prompt engineering and the quality of the model. You may need to change
64-
wording or add more description if you are not getting the results you want. In some cases, the model might not be
65-
capable of intelligently handling the complex function calls.
66+
### Authentication
67+
68+
For OpenAI-compatible providers, GPTScript will look for an API key to be configured with the
69+
prefix `GPTSCRIPT_PROVIDER_`, the base domain converted to environment variable format, and a suffix of `_API_KEY`.
70+
For example, if you are using `mistral-large-latest from https://api.mistral.ai/v1`, the environment variable would
71+
be `GPTSCRIPT_PROVIDER_API_MISTRAL_AI_API_KEY`.
72+
73+
### Listing available models
74+
75+
You can list models from an OpenAI-compatible API like this:
76+
77+
```bash
78+
gptscript --list-models https://api.mistral.ai/v1
79+
```

0 commit comments

Comments
 (0)