Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Rust-based openai api proxy server in node hub #678

Merged
merged 4 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 73 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ members = [
"node-hub/dora-record",
"node-hub/dora-rerun",
"node-hub/terminal-print",
"node-hub/openai-proxy-server",
"libraries/extensions/ros2-bridge",
"libraries/extensions/ros2-bridge/msg-gen",
"libraries/extensions/ros2-bridge/python",
Expand Down
16 changes: 16 additions & 0 deletions examples/openai-server/dataflow-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
nodes:
- id: dora-openai-server
build: cargo build -p dora-openai-proxy-server --release
path: ../../target/release/dora-openai-proxy-server
outputs:
- chat_completion_request
inputs:
completion_reply: dora-echo/echo

- id: dora-echo
build: pip install -e ../../node-hub/dora-echo
path: dora-echo
inputs:
echo: dora-openai-server/chat_completion_request
outputs:
- echo
27 changes: 27 additions & 0 deletions node-hub/openai-proxy-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "dora-openai-proxy-server"
version.workspace = true
edition = "2021"
documentation.workspace = true
description.workspace = true
license.workspace = true
repository.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tokio = { version = "1.36.0", features = ["full"] }
dora-node-api = { workspace = true, features = ["tracing"] }
eyre = "0.6.8"
chrono = "0.4.31"
tracing = "0.1.27"
serde = { version = "1.0.130", features = ["derive"] }
serde_json = "1.0.68"
url = "2.2.2"
indexmap = { version = "2.6.0", features = ["serde"] }
hyper = { version = "0.14", features = ["full"] }
thiserror = "1.0.37"
uuid = { version = "1.10", features = ["v4"] }
mime_guess = "2.0.4"
futures = "0.3.31"
tokio-stream = "0.1.11"
Loading
Loading