Rust API for LlamaEdge
The llamaedge crate provides convenient access to the LlamaEdge REST API from any Rust application. The crate includes type definitions for all request params and response fields, and offers both synchronous and asynchronous clients.
[!IMPORTANT] This project is still in the early stages of development. The API is not stable and may change.
Usage
Add the following to your Cargo.toml:
[]
= "0.0.1"
= "0.23.0"
= { = "1.42.0", = ["full"] }
Then, you can use the following code to send a chat completion request:
use ;
use ;
async
Note: To run the example, LlamaEdge API server should be deployed and running on your local machine. Refer to Quick Start for more details on how to deploy and run the server.
Examples
- Chat shows how to run a chat completion task.
- Transcribe Audio shows how to run a transcription task.
- Translate Audio shows how to run a translation task.
- Create Image shows how to run a image creation task.