diff options
author | Xuan Son Nguyen <thichthat@gmail.com> | 2024-03-11 10:56:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-11 10:56:41 +0100 |
commit | caa106d4e05a0ab94225c220b81f9e2cd522339b (patch) | |
tree | d9acbea2801af1260358cfb1e1b964a26ea6fa1f /examples/server/README.md | |
parent | 3202361c5b1ba15e695b31209567ef42c22c5c32 (diff) |
Server: format error to json (#5961)
* server: format error to json
* server: do not crash on grammar error
* fix api key test case
* revert limit max n_predict
* small fix
* correct coding style
* update completion.js
* launch_slot_with_task
* update docs
* update_slots
* update webui
* update readme
Diffstat (limited to 'examples/server/README.md')
-rw-r--r-- | examples/server/README.md | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/examples/server/README.md b/examples/server/README.md index 23606b32..37673905 100644 --- a/examples/server/README.md +++ b/examples/server/README.md @@ -556,9 +556,51 @@ Run with bash: bash chat.sh ``` -### API like OAI +### OAI-like API -The HTTP server supports OAI-like API +The HTTP server supports OAI-like API: https://github.com/openai/openai-openapi + +### API errors + +Server returns error in the same format as OAI: https://github.com/openai/openai-openapi + +Example of an error: + +```json +{ + "error": { + "code": 401, + "message": "Invalid API Key", + "type": "authentication_error" + } +} +``` + +Apart from error types supported by OAI, we also have custom types that are specific to functionalities of llama.cpp: + +**When /metrics or /slots endpoint is disabled** + +```json +{ + "error": { + "code": 501, + "message": "This server does not support metrics endpoint.", + "type": "not_supported_error" + } +} +``` + +**When the server receives invalid grammar via */completions endpoint** + +```json +{ + "error": { + "code": 400, + "message": "Failed to parse grammar", + "type": "invalid_request_error" + } +} +``` ### Extending or building alternative Web Front End |