Deployment Options

Choose the Node target unless a named platform constraint determines otherwise. Choose LangSmith when that platform must own the LangGraph deployment envelope. Choose Hono only when a web-standard edge runtime is required and the application fits its explicit capability gate.

Choose a target

TargetArtifactRuntime and protocolMiddlewareStorageFilesystem and sandboxNode requirementEvidence boundary
Node.b4/build/server.mjs and a generated DockerfileB4.run HTTP runtime: Agent Protocol and AG-UIB4.run HTTP middleware is includedLocal defaults or injected/shared storesFilesystem features and a configured execution sandbox are availableNode 24+Local runtime and container tests; validate your deployed proxy, stores, and model path
LangSmith.b4/build/langgraph.json and one entry per routePlatform-owned LangGraph entries, not the B4.run HTTP serverB4.run HTTP middleware is absentPlatform/runtime-ownedNo B4.run sandbox manager or HTTP filesystem surfaceGenerated config currently says Node 22 while B4.run requires Node 24+Validate authentication and execution on the target platform
Hono.b4/build/modules.edge.mjs, stores.mjs, app.mjs, and wrangler.tomlWeb-standard B4.run HTTP runtime: Agent Protocol and AG-UIIncluded when discovered at build timeGenerated request-scoped Postgres stores, or hand-composed storesFilesystem, shell, workspace, skills, long-term memory, and sandbox surfaces are gatedNo Node runtime requirement for the emitted workerLocal workerd and Node round trips are not proof of a live provider deployment

Node and LangSmith are the defaults. Hono is opt-in. Specifying build targets replaces the defaults; it does not add to them:

b4.config.ts
import { config } from "@b4run/cli"
 
export default config({
  build: { targets: ["node", "hono"] },
})

Validate and build

Run the checks in this order so contract failures appear before artifact inspection:

bash
b4 check
b4 build
b4 verify

b4 check validates the authored app and selected target constraints. b4 build emits the selected artifacts. b4 verify repeats the app, route, typegen, dependency/environment, and runtime-readiness phases against the resulting project state. A green command is not a substitute for testing the deployed authentication, routing, storage, and provider boundary.

Target guides

Production foundations

Deployment packaging does not decide data durability, replica coordination, or the external security boundary. Review these before exposing any target:

What B4.run does not do

B4.run emits deployment artifacts; it does not provision infrastructure, host applications, or manage secrets. Use the Deployment Options chooser with the target platform's hosting and security controls.

Self-hosting

Use Node and Docker when you want to run the full B4.run HTTP runtime on infrastructure you operate.

Troubleshooting

  • If expected files are missing, inspect build.targets: an authored list replaces the Node and LangSmith defaults.
  • If b4 build succeeds but the deployed host cannot import a package, verify that packages imported by emitted artifacts are declared where the host installs or bundles production dependencies.
  • If local protocol tests pass but the target fails, test the target's real transport envelope, authentication layer, environment injection, and durable stores. Node/Hono HTTP evidence does not establish LangSmith behavior, and local workerd evidence does not establish a live edge provider.

Deploying to production (Node/Docker)

This section moved to Node and Docker.

Deploying on Kubernetes

This section moved to Kubernetes.

The LangSmith / LangGraph Platform path

This section moved to LangSmith.

Edge runtimes

This section moved to Edge and Hono.

The @b4run/cli/fetch entry point

See Edge and Hono.

The hono build target

See Edge and Hono.

Why the stores are per-request

See Edge and Hono.

What the edge cannot serve

See Edge and Hono.

What is proven, and what is not

See Edge and Hono.

Continue with Production Topology, Persistence and Tenancy, and Security Architecture before exposing a deployment.