Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Open Interpreter docs #70

Merged
merged 2 commits into from
Feb 7, 2025
Merged
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
6 changes: 6 additions & 0 deletions docs/about/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ Major features and changes are noted here. To review all updates, see the

Related: [Upgrade CodeGate](../how-to/install.md#upgrade-codegate)

- **New integration: Open Interpreter** - xx Feb\
2025 CodeGate v0.1.16 introduces support for
[Open Interpreter](https://github.com/openinterpreter/open-interpreter) with
OpenAI-compatible APIs. Review the
[integration guide](../integrations/open-interpreter.mdx) to get started.

- **New integration: Cline** - 28 Jan, 2025\
CodeGate version 0.1.14 adds support for [Cline](https://cline.bot/) with
Anthropic, OpenAI, Ollama, and LM Studio. See the
Expand Down
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ AI coding assistants / IDEs:
CodeGate supports Ollama, Anthropic, OpenAI-compatible APIs, and LM Studio
with Cline.

- **[Open Interpreter](./integrations/open-interpreter.mdx)** with
OpenAI-compatible APIs

As the project evolves, we plan to add support for more IDE assistants and AI
model providers.

Expand Down
94 changes: 94 additions & 0 deletions docs/integrations/open-interpreter.mdx
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
```