Skip to content

Commit 520eb91

Browse files
authored
Merge pull request #49 from semanser/multi-llm-support
Add multi LLMs support
2 parents 47d0d31 + 63b7817 commit 520eb91

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2321
-873
lines changed

README.md

+14-24
Original file line numberDiff line numberDiff line change
@@ -14,47 +14,37 @@
1414
- 🤳 Self-hosted
1515
- 💅 Modern UI
1616

17-
# Usage
17+
# Getting started
1818
The simplest way to run Codel is to use a pre-built Docker image. You can find the latest image on the [Github Container Registry](https://github.com/semanser/codel/pkgs/container/codel).
1919

2020

2121
> [!IMPORTANT]
22-
> Don't forget to set the required environment variables.
22+
> You need to use a corresponding environment variable in order to use any of the supported language models.
2323
24+
You can run the Docker image with the following command. Remove or change the environment variables according to your needs.
2425
```bash
25-
docker run -d \
26-
-e OPEN_AI_KEY=<your_open_ai_key> \
26+
docker run \
27+
-e OPEN_AI_KEY=your_open_ai_key \
28+
-e OPEN_AI_MODEL=gpt-4-0125-preview \
29+
-e OLLAMA_MODEL=llama2 \
2730
-p 3000:8080 \
2831
-v /var/run/docker.sock:/var/run/docker.sock \
2932
ghcr.io/semanser/codel:latest
3033
```
3134

32-
Alternatively, you can create a .env file and run the Docker image with the following command:
33-
```bash
34-
docker run -d \
35-
--env-file .env \
36-
-p 3000:8080 \
37-
-v /var/run/docker.sock:/var/run/docker.sock \
38-
ghcr.io/semanser/codel:latest
39-
```
35+
Alternatively, you can create a `.env` file and run the Docker image with the `--env-file` flag. More information can be found [here](https://docs.docker.com/reference/cli/docker/container/run/#env)
4036

4137
Now you can visit [localhost:3000](localhost:3000) in your browser and start using Codel.
4238

4339
<details>
44-
<summary>Required environment variables</summary>
45-
46-
- `OPEN_AI_KEY` - OpenAI API key
47-
</details>
48-
49-
<details>
50-
<summary>Optional environment variables</summary>
51-
52-
- `OPEN_AI_MODEL` - OpenAI model (default: gpt-4-0125-preview). The list of supported OpenAI models can be found [here](https://pkg.go.dev/github.com/sashabaranov/go-openai#pkg-constants).
53-
- `DATABASE_URL` - PostgreSQL database URL (eg. `postgres://user:password@localhost:5432/database`)
54-
- `DOCKER_HOST` - Docker SDK API (eg. `DOCKER_HOST=unix:///Users/<my-user>/Library/Containers/com.docker.docker/Data/docker.raw.sock`) [more info](https://stackoverflow.com/a/62757128/5922857)
55-
- `PORT` - Port to run the server in the Docker container (default: 8080)
40+
<summary>Supported environment variables</summary>
5641

42+
* `OPEN_AI_KEY` - OpenAI API key. You can get the key [here](https://platform.openai.com/account/api-keys).
43+
* `OPEN_AI_MODEL` - OpenAI model (default: gpt-4-0125-preview). The list of supported OpenAI models can be found [here](https://pkg.go.dev/github.com/sashabaranov/go-openai#pkg-constants).
44+
* `OPEN_AI_SERVER_URL` - OpenAI server URL (default: https://api.openai.com/v1). Change this URL if you are using an OpenAI compatible server.
45+
* `OLLAMA_MODEL` - locally hosted Ollama model (default: https://ollama.com/model). The list of supported Ollama models can be found [here](https://ollama.com/models).
5746
See backend [.env.example](./backend/.env.example) for more details.
47+
5848
</details>
5949

6050
# Development

backend/.env.example

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
OPEN_AI_KEY=
2-
OPEN_AI_SERVER_URL=
1+
# General
32
DATABASE_URL=
43
DOCKER_HOST=
4+
PORT=
5+
6+
# OpenAI
7+
OPEN_AI_KEY=
8+
OPEN_AI_SERVER_URL=
59
OPEN_AI_MODEL=
6-
PORT=
10+
11+
# Ollama
12+
OLLAMA_MODEL=
13+
14+
# Goose
15+
GOOSE_DRIVER=
16+
GOOSE_DBSTRING=

0 commit comments

Comments
 (0)