|
14 | 14 | - 🤳 Self-hosted
|
15 | 15 | - 💅 Modern UI
|
16 | 16 |
|
17 |
| -# Usage |
| 17 | +# Getting started |
18 | 18 | 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).
|
19 | 19 |
|
20 | 20 |
|
21 | 21 | > [!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. |
23 | 23 |
|
| 24 | +You can run the Docker image with the following command. Remove or change the environment variables according to your needs. |
24 | 25 | ```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 \ |
27 | 30 | -p 3000:8080 \
|
28 | 31 | -v /var/run/docker.sock:/var/run/docker.sock \
|
29 | 32 | ghcr.io/semanser/codel:latest
|
30 | 33 | ```
|
31 | 34 |
|
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) |
40 | 36 |
|
41 | 37 | Now you can visit [localhost:3000](localhost:3000) in your browser and start using Codel.
|
42 | 38 |
|
43 | 39 | <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> |
56 | 41 |
|
| 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). |
57 | 46 | See backend [.env.example](./backend/.env.example) for more details.
|
| 47 | + |
58 | 48 | </details>
|
59 | 49 |
|
60 | 50 | # Development
|
|
0 commit comments