Skip to Content
sdkexamplespythontext-completionREADME

Last Updated: 3/9/2026


Text Completion Example

A simple text completion Python inferlet.

Setup (One-Time)

From the pie repository root:

cd sdk/python uv venv source .venv/bin/activate uv pip install -e ".[dev]" uv pip install -e ../tools/bakery

Build

From the pie repository root (with venv activated):

# Build bakery build "$PWD/sdk/examples/python/text-completion" \ -o "$PWD/text-completion.wasm"

Run

Requires a running Pie engine:

# Submit inferlet (arguments go after --) pie-cli submit text-completion.wasm -- --prompt "What is Python?"

Arguments

ArgumentDefaultDescription
prompt”Hello, world!”User prompt
max_tokens256Maximum tokens to generate
system”You are a helpful assistant.”System prompt