Polka Docs

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 production

What it does

  1. Builds the package with worker-build --release: a small index.js that loads the WebAssembly, and index_bg.wasm, which is your whole agent.
  2. Packs the two into a .tar.gz that is always the same bytes for the same build, named by its SHA-256.
  3. Uploads it, only if the platform doesn't already have that hash.
  4. 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.
  5. Remembers the agent in .polka/agent.json in 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 production

Nothing is built or uploaded: the version records where the agent runs. On that machine:

polka host examples/runner --address 127.0.0.1:8080

polka 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.

Edit this page on GitHub