-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
--- | ||
title: Use CodeGate with Open Interpreter | ||
description: Configure Open Interpreter to use CodeGate | ||
sidebar_label: Open Interpreter | ||
sidebar_position: 70 | ||
--- | ||
|
||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
[Open Interpreter](https://github.com/openinterpreter/open-interpreter) lets | ||
LLMs run code locally through a ChatGPT-like interface in your terminal. | ||
|
||
CodeGate works with [OpenAI](https://openai.com/api/) and OpenAI-compatible APIs | ||
through Open Interpreter. | ||
|
||
:::note | ||
|
||
This guide assumes you have already installed Open Interpreter using their | ||
[installation instructions](https://docs.openinterpreter.com/getting-started/setup). | ||
|
||
::: | ||
|
||
## Configure Open Interpreter to use CodeGate | ||
|
||
To configure Open Interpreter to send requests through CodeGate, run | ||
`interpreter` with the | ||
[API base setting](https://docs.openinterpreter.com/settings/all-settings#api-base) | ||
set to CodeGate's local API port, `http://localhost:8989/openai`. | ||
|
||
By default, CodeGate connects to the [OpenAI API](https://openai.com/api/). To | ||
use a different OpenAI-compatible endpoint, set the `CODEGATE_OPENAI_URL` | ||
[configuration parameter](../how-to/configure.md#config-parameters) when you run | ||
CodeGate. | ||
|
||
<Tabs> | ||
<TabItem value="current" label="Open Interpreter v0.4.x" default> | ||
```bash | ||
interpreter --api_base http://localhost:8989/openai --api_key YOUR_API_KEY --model MODEL_NAME | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="dev" label="v1.0 dev branch"> | ||
If you are running Open Interpreter's v1.0 | ||
[development branch](https://github.com/OpenInterpreter/open-interpreter/tree/development): | ||
|
||
```bash | ||
interpreter --api-base http://localhost:8989/openai --api-key YOUR_API_KEY --model MODEL_NAME | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
Replace `YOUR_API_KEY` with your OpenAI API key, and `MODEL_NAME` with your | ||
desired model, like `openai/gpt-4o-mini`. | ||
|
||
:::info | ||
|
||
The `--model` parameter value must start with `openai/` for CodeGate to properly | ||
handle the request. | ||
|
||
::: | ||
|
||
## Verify configuration | ||
|
||
To verify that you've successfully connected Open Interpreter to CodeGate, type | ||
`codegate version` into the Open Interpreter chat. You should receive a response | ||
like "CodeGate version 0.1.16". | ||
|
||
## Next steps | ||
|
||
Learn more about [CodeGate's features](../features/index.mdx) and explore the | ||
[dashboard](../how-to/dashboard.md). | ||
|
||
## Remove CodeGate | ||
|
||
If you decide to stop using CodeGate, follow these steps to remove it and revert | ||
your environment. | ||
|
||
1. Quit Open Interpreter (<key>Ctrl</key>+<key>C</key>) and re-run it without | ||
the API base parameter. | ||
|
||
1. Stop and remove the CodeGate container: | ||
|
||
```bash | ||
docker stop codegate && docker rm codegate | ||
``` | ||
|
||
1. If you launched CodeGate with a persistent volume, delete it to remove the | ||
CodeGate database and other files: | ||
|
||
```bash | ||
docker volume rm codegate_volume | ||
``` |