0xPlaygrounds / 0xPlaygrounds/rig
feat: WASI support
- Vorherrschende Sprache
- Rust
- Sterne
- 8.6k
- Forks
- 959
- Ø Merge
- 4 Std. 32 Min.
- Gemergte PRs (30 T.)
- 117
Beschreibung
- [X] I have looked for existing issues (including closed) about this
## Feature Request
A description of what WASI is:
> The WebAssembly System Interface (WASI) is a group of standards-track API specifications for software compiled to the [W3C WebAssembly (Wasm) standard](). WASI is designed to provide a secure standard interface for applications that can be compiled to Wasm from any language, and that may run anywhere—from browsers to clouds to embedded devices.
This ticket is a natural evolution of us having implemented (and currently maintaining) WASM support.
### Motivation
The motivation is that we'll be able to run Rig from literally anything/anywhere that has a WASI runtime, like `wasmtime` or `wasmer`.
### Proposal
The current blockers are as follows:
* The `worker` crate requires some features from `tokio` that are fundamentally incompatible with WASI.
Therefore we will need to completely divorce the `worker::send` macro from the completion model implementations and add a WASI friendly client feature (potentially through `wasi-http` or something else).
Steps required to solve this:
* Fully divorce `worker` crate from `rig::completion::CompletionModel` implementations
* Add a HTTP implementation for a WASM/WASI-friendly HTTP client
* Test that it works
* Add it
Blocked by [RIG-996](https://linear.app/playgrounds-ai/issue/RIG-996/feat-allow-generic-clients-for-streaming-completions)
### Alternatives
Beitragsleitfaden
Rechercherichtung
The issue is blocked by RIG-996 and requires deep changes to the `worker` crate and `rig::completion::CompletionModel`. Start by examining the `worker` crate's dependencies on `tokio` features. Look for the `worker::send` macro and the completion model implementations. Research `wasi-http` for a WASI-friendly HTTP client. Testing will involve building for a WASI target and running with `wasmtime` or `wasmer`.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rust, wasm
- Bereich
- backend, cli, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100