Skip to content

Commit

Permalink
Fix: Upstream URL for llama2 completion example (#7242)
Browse files Browse the repository at this point in the history
* Update _llama2.md

The example provided in the curl command references the ollama endpoint, http://ollama-server.local:11434/v1/chat, which returns a 404.

Per the docs (referenced earlier on this page), the correct endpoint should be /api/chat which I can confirm works.

https://github.com/ollama/ollama/blob/main/docs/api.md#generate-a-chat-completion

* fix upstream url in curl example

---------

Co-authored-by: lena-larionova <[email protected]>
  • Loading branch information
dascole and lena-larionova committed Apr 16, 2024
1 parent aec7e38 commit 0434574
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/_hub/kong-inc/ai-proxy/how-to/_llama2.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ curl -X POST http://localhost:8001/routes/llama2-chat/plugins \
--data "config.model.provider=llama2" \
--data "config.model.name=llama2" \
--data "config.model.options.llama2_format=ollama" \
--data "config.model.options.upstream_url=http://ollama-server.local:11434/v1/chat" \
--data "config.model.options.upstream_url=http://ollama-server.local:11434/api/chat" \
```

{% endnavtab %}
Expand All @@ -108,7 +108,7 @@ plugins:
provider: "llama2"
name: "llama2"
llama2_format: "ollama"
upstream_url: "http://llama2-server.local:11434/v1/chat"
upstream_url: "http://llama2-server.local:11434/api/chat"
```
{% endnavtab %}
{% endnavtabs %}
Expand All @@ -121,4 +121,4 @@ Make an `llm/v1/chat` type request to test your new endpoint:
curl -X POST http://localhost:8000/llama2-chat \
-H 'Content-Type: application/json' \
--data-raw '{ "messages": [ { "role": "system", "content": "You are a mathematician" }, { "role": "user", "content": "What is 1+1?"} ] }'
```
```

0 comments on commit 0434574

Please sign in to comment.