Last Updated: 4/8/2026
Quickstart
Build and run your first Pie inferlet in just a few minutes.
Step 1: Install Pie
First, install the Pie server and client:
pip install pie-clientStep 2: Create an Inferlet
Create a new Rust project:
cargo new my-first-inferlet
cd my-first-inferletAdd the inferlet SDK dependency in Cargo.toml:
[dependencies]
inferlet = "0.1"Write your inferlet in src/main.rs:
use inferlet::{Args, Result, Sampler, get_auto_model};
use inferlet::stop_condition::max_len;
#[inferlet::main]
async fn main(mut args: Args) -> Result<String> {
let model = get_auto_model();
let mut ctx = model.create_context();
let prompt = args.get("prompt").unwrap_or("Hello!");
ctx.fill_user(prompt);
let sampler = Sampler::top_p(0.6, 0.95);
let stop = max_len(50);
let response = ctx.generate(sampler, stop).await;
Ok(response)
}Step 3: Build to WebAssembly
cargo build --target wasm32-wasi --releaseStep 4: Run Your Inferlet
pie run ./target/wasm32-wasi/release/my-first-inferlet.wasm -- --prompt "Tell me a joke"What’s Next?
- Learn about Server Mode
- Explore Client Basics
- Dive into Writing Inferlets