graniet / graniet/llm

Build fails on WASM as reqwest::blocking is not available

Open
#8 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
365
Forks
90
PR merge metrics
No merged PRs in 30d

Description

On wasm targets only async calls are available.
As a result, `reqwest::blocking::Client` is not available.
`reqwest::Client` (the async version of the client) should be used instead.

To support this there are two choices:
1. Expose blocking as well as non-blocking APIs for the `llm` crate, with only the latter available on WASM.
2. Breaking change: make all the API's non-blocking, thus exposing a single async surface.

Personally I'm in favor of the latter as there isn't a good reason to have these calls block.

Contributor guide

Open the contributing guide

Research direction

Start by locating the uses of reqwest::blocking::Client and the corresponding reqwest::Client APIs in the llm crate. Review how the current blocking and non-blocking surfaces are exposed, then determine which API direction is required for WASM support. Done means the chosen API design is implemented consistently and the crate builds for WASM.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
backend-api-design, build-system
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.