Deployment Options

Use the Node target unless a platform constraint says otherwise. Choose LangSmith when that platform must run the LangGraph deployment. Choose Hono only when you need a web-standard edge runtime and your app fits its capability gate. Choose Vercel when you host on Vercel's Node 24 Fluid runtime and your app fits the same capability subset.

Choose a targetCopy link to section: Choose a target

NodeCopy link to section: Node

  • Artifacts: .b4/build/server.mjs and a generated Dockerfile
  • Runtime: the B4.run HTTP runtime (Agent Protocol, AG-UI and middleware)
  • Storage: local defaults, or injected shared stores
  • Filesystem and sandbox: both available
  • Requires: Node 24+
  • Tested by: local runtime and container tests. Validate your proxy, stores and model path.

LangSmithCopy link to section: LangSmith

  • Artifacts: .b4/build/langgraph.json and one entry per route
  • Runtime: LangGraph entries run by the platform, without B4.run's HTTP server or middleware
  • Storage: provided by the platform
  • Filesystem and sandbox: no B4.run sandbox manager or HTTP filesystem surface
  • Requires: the generated config currently says Node 22, while B4.run requires Node 24+
  • Tested by: you, on the platform

HonoCopy link to section: Hono

  • Artifacts: .b4/build/modules.edge.mjs, stores.mjs, app.mjs and wrangler.toml
  • Runtime: the web-standard B4.run HTTP runtime (Agent Protocol, AG-UI and middleware found at build time)
  • Storage: generated request-scoped Postgres stores, or stores you compose by hand
  • Filesystem and sandbox: filesystem, shell, workspace, long-term memory and sandbox surfaces are gated
  • Requires: no Node runtime for the emitted worker
  • Tested by: local workerd and Node round trips, which don't prove a live provider deployment

VercelCopy link to section: Vercel

  • Artifacts: a .vercel/output/ Build Output API tree (the runtime function, plus any static/, functions and routes from build.vercel) and a reconciled vercel.json
  • Runtime: the same web-standard runtime as Hono, on Vercel's Node 24 Fluid runtime
  • Storage: generated request-scoped Postgres stores over DATABASE_URL
  • Filesystem and sandbox: the same gate as Hono
  • Requires: the Vercel nodejs24.x function runtime
  • Tested by: a gated CI lane that deploys real previews. Validate your project's auth, regions and provider path.

Node and LangSmith are the defaults, and Hono and Vercel are opt-in. Specifying build targets replaces the defaults. It doesn't add to them:

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

Validate and buildCopy link to section: Validate and build

Run the checks in this order, so problems with the app show up before you inspect artifacts:

bash
b4 check
b4 build
b4 verify

b4 check validates the authored app and the selected targets' constraints. b4 build emits the selected artifacts. b4 verify repeats the app, route, typegen, dependency, environment and runtime-readiness phases against the resulting project. Green commands are a good start, but you still need to test the deployed authentication, routing, storage and provider path.

Target guidesCopy link to section: Target guides

Production foundationsCopy link to section: Production foundations

Packaging leaves data durability, replica coordination and outer security to you. Review these before you expose any target:

What B4.run does not doCopy link to section: What B4.run does not do

B4.run emits deployment artifacts. Provisioning infrastructure, hosting the app and managing secrets are up to your target platform.

Self-hostingCopy link to section: Self-hosting

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

TroubleshootingCopy link to section: 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 can't import a package, declare every package the emitted artifacts import where the host installs or bundles production dependencies.
  • If local protocol tests pass but the target fails, test the target's real transport, authentication layer, environment injection and durable stores. Passing Node or Hono HTTP tests tell you nothing about LangSmith, and a local workerd run tells you nothing about a live edge provider.

See Production Foundations before you expose a deployment.