Skip to content

Commit

Permalink
docs: update ollama API Service integration and usage instructions (#162
Browse files Browse the repository at this point in the history
)

- Add instructions for changing to ollama API Service
- Include usage examples for the `ollama` API Service
- Update the `base_url` in the config file without setting the `api_key`

Signed-off-by: appleboy <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed May 11, 2024
1 parent 1fed520 commit e8b58c4
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,41 @@ Support the [following models][32]:
[31]: https://console.groq.com/keys
[32]: https://console.groq.com/docs/models

### How to change to ollama API Service

We can use the Llama3 model from the [ollama][41] API Service, please visit [here][40]. Update the `base_url` in your config file.

[40]: https://github.com/ollama/ollama/blob/main/docs/openai.md#models
[41]: https://github.com/ollama/ollama

```sh
# pull llama3 8b model
ollama pull llama3
ollama cp llama3 gpt-3.5-turbo
```

Try to use the `ollama` API Service.

```sh
curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "user",
"content": "Hello!"
}
]
}'
```

Update the `base_url` in your config file. You don't need to set the `api_key` in the config file.

```sh
codegpt config set openai.base_url http://localhost:11434/v1
```

## Usage

There are two methods for generating a commit message using the `codegpt` command. The first is CLI mode, and the second is Git Hook.
Expand Down

0 comments on commit e8b58c4

Please sign in to comment.