Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Rust-based openai api proxy server in node hub (#678)
This is a Rust-based version of #676 based on https://github.com/LlamaEdge/LlamaEdge/tree/main/llama-api-server . It includes `serde` structs to fully deserialize chat completion requests. The server replies to requests asynchronously, which makes it possible to serve multiple clients at the same time. Note that replies are mapped to requests purely based on their order right now. So the first reply is assigned to the first request and so on. If the order of replies is different (e.g. because some completions take longer), some form of ID needs to be added to the code to enable a proper `request<->reply` mapping. Like #676, this PR only implements basic chat completion requests. You can try it through these steps: ```bash cd examples/openai-server dora build dataflow-rust.yml dora start dataflow-rust.yml # In a separate terminal python openai_api_client.py ``` I didn't implement the `/v1/models` endpoint, so the _"Testing API endpoints..."_ part of `openai_api_client.py` is expected to fail with _"Error listing models: 404"_.
- Loading branch information