Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions site/src/docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ The examples also work against any OpenAI-compatible gateway, such as [OrcaRoute
OPENAI_ENDPOINT=https://api.orcarouter.ai/v1/chat/completions
```

With [Standard Compute](https://standardcompute.com), the `StandardCompute` model routes each request to the cheapest enabled model that can handle it, with automatic fallback:

```
OPENAI_API_KEY=<your Standard Compute API key, e.g. the value of STANDARDCOMPUTE_API_KEY>
OPENAI_MODEL=StandardCompute
OPENAI_ENDPOINT=https://api.stdcmpt.com/v1/chat/completions
```

## Step 4: Run the examples

Examples can be found in the `typescript/examples` directory.
Expand Down
10 changes: 10 additions & 0 deletions site/src/docs/python/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,16 @@ OPENAI_MODEL=<model name>
OPENAI_ENDPOINT=https://api.orcarouter.ai/v1/chat/completions
```

For example, to use [Standard Compute](https://standardcompute.com), whose
`StandardCompute` model routes each request to the cheapest enabled model that
can handle it, with automatic fallback:

```
OPENAI_API_KEY=<your Standard Compute API key, e.g. the value of STANDARDCOMPUTE_API_KEY>
OPENAI_MODEL=StandardCompute
OPENAI_ENDPOINT=https://api.stdcmpt.com/v1/chat/completions
```

The HTTP models returned by `create_language_model`,
`create_openai_language_model`, and `create_azure_openai_language_model` have a
few writable attributes you might find useful:
Expand Down
10 changes: 10 additions & 0 deletions site/src/docs/typescript/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,16 @@ OPENAI_MODEL=<model name>
OPENAI_ENDPOINT=https://api.orcarouter.ai/v1/chat/completions
```

For example, to use [Standard Compute](https://standardcompute.com), whose
`StandardCompute` model routes each request to the cheapest enabled model that
can handle it, with automatic fallback:

```
OPENAI_API_KEY=<your Standard Compute API key, e.g. the value of STANDARDCOMPUTE_API_KEY>
OPENAI_MODEL=StandardCompute
OPENAI_ENDPOINT=https://api.stdcmpt.com/v1/chat/completions
```

Regardless, of how you decide to construct your model, it is important to avoid committing credentials directly in source.
One way to make this work between production and development environments is to use a `.env` file in development, and specify that `.env` in your `.gitignore`.
You can use a library like [`dotenv`](https://www.npmjs.com/package/dotenv) to help load these up.
Expand Down