Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
82eae1fd
Unverified
Commit
82eae1fd
authored
Jun 30, 2025
by
Paul Hendricks
Committed by
GitHub
Jun 30, 2025
Browse files
refactor: Upgrade async-openai (#1693)
parent
0b47f897
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
39 additions
and
17 deletions
+39
-17
Cargo.lock
Cargo.lock
+14
-2
Cargo.toml
Cargo.toml
+1
-0
launch/dynamo-run/Cargo.toml
launch/dynamo-run/Cargo.toml
+1
-1
lib/bindings/python/Cargo.lock
lib/bindings/python/Cargo.lock
+14
-2
lib/bindings/python/Cargo.toml
lib/bindings/python/Cargo.toml
+1
-1
lib/engines/mistralrs/Cargo.toml
lib/engines/mistralrs/Cargo.toml
+1
-1
lib/llm/Cargo.toml
lib/llm/Cargo.toml
+1
-1
lib/llm/src/preprocessor/prompt/template/oai.rs
lib/llm/src/preprocessor/prompt/template/oai.rs
+6
-9
No files found.
Cargo.lock
View file @
82eae1fd
...
@@ -199,10 +199,11 @@ checksum = "4288f83726785267c6f2ef073a3d83dc3f9b81464e9f99898240cced85fce35a"
...
@@ -199,10 +199,11 @@ checksum = "4288f83726785267c6f2ef073a3d83dc3f9b81464e9f99898240cced85fce35a"
[[package]]
[[package]]
name = "async-openai"
name = "async-openai"
version = "0.2
7.2
"
version = "0.2
9.0
"
source = "registry+https://github.com/rust-lang/crates.io-index"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "
2d126927c78e1562d7e8473008ac8b082318c04d69e3a83e3495a563f8b84a66
"
checksum = "
31acf814d6b499e33ec894bb0fd7ddaf2665b44fbdd42b858d736449271fde0c
"
dependencies = [
dependencies = [
"async-openai-macros",
"backoff",
"backoff",
"base64 0.22.1",
"base64 0.22.1",
"bytes",
"bytes",
...
@@ -222,6 +223,17 @@ dependencies = [
...
@@ -222,6 +223,17 @@ dependencies = [
"tracing",
"tracing",
]
]
[[package]]
name = "async-openai-macros"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0289cba6d5143bfe8251d57b4a8cac036adf158525a76533a7082ba65ec76398"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.100",
]
[[package]]
[[package]]
name = "async-stream"
name = "async-stream"
version = "0.3.6"
version = "0.3.6"
...
...
Cargo.toml
View file @
82eae1fd
...
@@ -46,6 +46,7 @@ dynamo-tokens = { path = "lib/tokens", version = "0.3.1" }
...
@@ -46,6 +46,7 @@ dynamo-tokens = { path = "lib/tokens", version = "0.3.1" }
# External dependencies
# External dependencies
anyhow
=
{
version
=
"1"
}
anyhow
=
{
version
=
"1"
}
async-nats
=
{
version
=
"0.40"
,
features
=
["service"]
}
async-nats
=
{
version
=
"0.40"
,
features
=
["service"]
}
async-openai
=
{
version
=
"0.29.0"
}
async-stream
=
{
version
=
"0.3"
}
async-stream
=
{
version
=
"0.3"
}
async-trait
=
{
version
=
"0.1"
}
async-trait
=
{
version
=
"0.1"
}
async_zmq
=
{
version
=
"0.4.0"
}
async_zmq
=
{
version
=
"0.4.0"
}
...
...
launch/dynamo-run/Cargo.toml
View file @
82eae1fd
...
@@ -45,7 +45,7 @@ tracing = { workspace = true }
...
@@ -45,7 +45,7 @@ tracing = { workspace = true }
tracing-subscriber
=
{
workspace
=
true
}
tracing-subscriber
=
{
workspace
=
true
}
uuid
=
{
workspace
=
true
}
uuid
=
{
workspace
=
true
}
async-openai
=
{
version
=
"0.27.2"
}
async-openai
=
{
workspace
=
true
}
clap
=
{
version
=
"4.5"
,
features
=
[
"derive"
,
"env"
]
}
clap
=
{
version
=
"4.5"
,
features
=
[
"derive"
,
"env"
]
}
dialoguer
=
{
version
=
"0.11"
,
default-features
=
false
,
features
=
[
"editor"
,
"history"
]
}
dialoguer
=
{
version
=
"0.11"
,
default-features
=
false
,
features
=
[
"editor"
,
"history"
]
}
futures-util
=
{
version
=
"0.3"
}
futures-util
=
{
version
=
"0.3"
}
...
...
lib/bindings/python/Cargo.lock
View file @
82eae1fd
...
@@ -180,10 +180,11 @@ checksum = "4288f83726785267c6f2ef073a3d83dc3f9b81464e9f99898240cced85fce35a"
...
@@ -180,10 +180,11 @@ checksum = "4288f83726785267c6f2ef073a3d83dc3f9b81464e9f99898240cced85fce35a"
[[package]]
[[package]]
name = "async-openai"
name = "async-openai"
version = "0.2
7.2
"
version = "0.2
9.0
"
source = "registry+https://github.com/rust-lang/crates.io-index"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "
2d126927c78e1562d7e8473008ac8b082318c04d69e3a83e3495a563f8b84a66
"
checksum = "
31acf814d6b499e33ec894bb0fd7ddaf2665b44fbdd42b858d736449271fde0c
"
dependencies = [
dependencies = [
"async-openai-macros",
"backoff",
"backoff",
"base64 0.22.1",
"base64 0.22.1",
"bytes",
"bytes",
...
@@ -203,6 +204,17 @@ dependencies = [
...
@@ -203,6 +204,17 @@ dependencies = [
"tracing",
"tracing",
]
]
[[package]]
name = "async-openai-macros"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0289cba6d5143bfe8251d57b4a8cac036adf158525a76533a7082ba65ec76398"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.100",
]
[[package]]
[[package]]
name = "async-stream"
name = "async-stream"
version = "0.3.6"
version = "0.3.6"
...
...
lib/bindings/python/Cargo.toml
View file @
82eae1fd
...
@@ -44,7 +44,7 @@ dynamo-runtime = { path = "../../runtime" }
...
@@ -44,7 +44,7 @@ dynamo-runtime = { path = "../../runtime" }
anyhow
=
{
version
=
"1"
}
anyhow
=
{
version
=
"1"
}
async-stream
=
{
version
=
"0.3"
}
async-stream
=
{
version
=
"0.3"
}
async-trait
=
{
version
=
"0.1"
}
async-trait
=
{
version
=
"0.1"
}
async-openai
=
"0.27.2"
async-openai
=
{
version
=
"0.29.0"
}
futures
=
{
version
=
"0.3"
}
futures
=
{
version
=
"0.3"
}
once_cell
=
{
version
=
"1.20.3"
}
once_cell
=
{
version
=
"1.20.3"
}
serde
=
{
version
=
"1"
}
serde
=
{
version
=
"1"
}
...
...
lib/engines/mistralrs/Cargo.toml
View file @
82eae1fd
...
@@ -34,7 +34,7 @@ dynamo-runtime = { workspace = true }
...
@@ -34,7 +34,7 @@ dynamo-runtime = { workspace = true }
dynamo-llm
=
{
workspace
=
true
}
dynamo-llm
=
{
workspace
=
true
}
anyhow
=
{
workspace
=
true
}
anyhow
=
{
workspace
=
true
}
async-openai
=
"0.27.2"
async-openai
=
{
workspace
=
true
}
async-stream
=
{
workspace
=
true
}
async-stream
=
{
workspace
=
true
}
async-trait
=
{
workspace
=
true
}
async-trait
=
{
workspace
=
true
}
candle-core
=
{
version
=
"0.8.0"
}
candle-core
=
{
version
=
"0.8.0"
}
...
...
lib/llm/Cargo.toml
View file @
82eae1fd
...
@@ -71,7 +71,7 @@ uuid = { workspace = true }
...
@@ -71,7 +71,7 @@ uuid = { workspace = true }
xxhash-rust
=
{
workspace
=
true
}
xxhash-rust
=
{
workspace
=
true
}
akin
=
"0.4.0"
akin
=
"0.4.0"
async-openai
=
"0.27.2"
async-openai
=
{
workspace
=
true
}
blake3
=
"1"
blake3
=
"1"
bytemuck
=
"1.22"
bytemuck
=
"1.22"
candle-core
=
{
version
=
"0.8.0"
}
candle-core
=
{
version
=
"0.8.0"
}
...
...
lib/llm/src/preprocessor/prompt/template/oai.rs
View file @
82eae1fd
...
@@ -98,15 +98,12 @@ impl OAIChatLikeRequest for NvCreateCompletionRequest {
...
@@ -98,15 +98,12 @@ impl OAIChatLikeRequest for NvCreateCompletionRequest {
fn
extract_tokens
(
&
self
)
->
Option
<
TokenInput
>
{
fn
extract_tokens
(
&
self
)
->
Option
<
TokenInput
>
{
match
&
self
.inner.prompt
{
match
&
self
.inner.prompt
{
async_openai
::
types
::
Prompt
::
IntegerArray
(
tokens
)
=>
Some
(
TokenInput
::
Single
(
async_openai
::
types
::
Prompt
::
IntegerArray
(
tokens
)
=>
{
tokens
.iter
()
.map
(|
&
t
|
t
as
u32
)
.collect
(),
Some
(
TokenInput
::
Single
(
tokens
.clone
()))
)),
}
async_openai
::
types
::
Prompt
::
ArrayOfIntegerArray
(
arrays
)
=>
Some
(
TokenInput
::
Batch
(
async_openai
::
types
::
Prompt
::
ArrayOfIntegerArray
(
arrays
)
=>
{
arrays
Some
(
TokenInput
::
Batch
(
arrays
.clone
()))
.iter
()
}
.map
(|
arr
|
arr
.iter
()
.map
(|
&
t
|
t
as
u32
)
.collect
())
.collect
(),
)),
_
=>
None
,
_
=>
None
,
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment