Skip to content

Commit 1cfde5b

Browse files
authored
Update documentation of OpenAI compatible server configuration (#1141)
Update README.md Fixed incorrect setup for extra parameters in OpenAI compatible server configuration (see PR #1032)
1 parent 0b4f7ba commit 1cfde5b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,12 @@ If `endpoints` are left unspecified, ChatUI will look for the model on the hoste
273273

274274
##### OpenAI API compatible models
275275

276-
Chat UI can be used with any API server that supports OpenAI API compatibility, for example [text-generation-webui](https://github.com/oobabooga/text-generation-webui/tree/main/extensions/openai), [LocalAI](https://github.com/go-skynet/LocalAI), [FastChat](https://github.com/lm-sys/FastChat/blob/main/docs/openai_api.md), [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), and [ialacol](https://github.com/chenhunghan/ialacol).
276+
Chat UI can be used with any API server that supports OpenAI API compatibility, for example [text-generation-webui](https://github.com/oobabooga/text-generation-webui/tree/main/extensions/openai), [LocalAI](https://github.com/go-skynet/LocalAI), [FastChat](https://github.com/lm-sys/FastChat/blob/main/docs/openai_api.md), [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), and [ialacol](https://github.com/chenhunghan/ialacol) and [vllm](https://docs.vllm.ai/en/latest/serving/openai_compatible_server.html).
277277

278278
The following example config makes Chat UI works with [text-generation-webui](https://github.com/oobabooga/text-generation-webui/tree/main/extensions/openai), the `endpoint.baseUrl` is the url of the OpenAI API compatible server, this overrides the baseUrl to be used by OpenAI instance. The `endpoint.completion` determine which endpoint to be used, default is `chat_completions` which uses `v1/chat/completions`, change to `endpoint.completion` to `completions` to use the `v1/completions` endpoint.
279279

280+
Parameters not supported by OpenAI (e.g., top_k, repetition_penalty, etc.) must be set in the extraBody of endpoints. Be aware that setting them in parameters will cause them to be omitted.
281+
280282
```
281283
MODELS=`[
282284
{
@@ -285,15 +287,17 @@ MODELS=`[
285287
"parameters": {
286288
"temperature": 0.9,
287289
"top_p": 0.95,
288-
"repetition_penalty": 1.2,
289-
"top_k": 50,
290-
"truncate": 1000,
291290
"max_new_tokens": 1024,
292291
"stop": []
293292
},
294293
"endpoints": [{
295294
"type" : "openai",
296-
"baseURL": "http://localhost:8000/v1"
295+
"baseURL": "http://localhost:8000/v1",
296+
"extraBody": {
297+
"repetition_penalty": 1.2,
298+
"top_k": 50,
299+
"truncate": 1000
300+
}
297301
}]
298302
}
299303
]`

0 commit comments

Comments
 (0)