Deploy
polka deploy turns your package into a new version of an agent and can put it live in an
environment. A version never changes once it is saved; an environment points at one version
and moves when you deploy to it.
polka deploy examples/runner --env productionWhat it does
- Builds the package with
worker-build --release: a smallindex.jsthat loads the WebAssembly, andindex_bg.wasm, which is your whole agent. - Packs the two into a
.tar.gzthat is always the same bytes for the same build, named by its SHA-256. - Uploads it, only if the platform doesn't already have that hash.
- Saves a version that runs that package. The platform checks that it unpacks and gives the version a key of its own for the model gateway. Your package never holds that key.
- Remembers the agent in
.polka/agent.jsonin your package, so the next deploy is a new version of the same agent.
Options
| Option | What it does |
|---|---|
--env <name> |
puts the version live in that environment, made on its first deploy |
--name <name> |
the agent's name (the folder's if left out) |
--greeting <text> |
what it says first in a conversation |
--keep <folder> |
a folder of its sandbox kept between a conversation's tasks; repeat for more |
--host <https://…> |
run it on a machine of your own instead of the edge |
On a machine of your own
polka deploy examples/runner --host https://agent.example.com --env productionNothing is built or uploaded: the version records where the agent runs. On that machine:
polka host examples/runner --address 127.0.0.1:8080polka host builds the package and answers the platform's turns, each task in a folder of its
own, confined. Put it behind TLS, and set the environment's POLKA_HOST_TOKEN variable in the
Console to the token the host was started with: the platform sends it with every turn.
After a deploy
Open the agent in the Console to talk to it, see its conversations and traces, and see what each one cost. On the edge explains what a deployed agent can reach and how it is billed.