ViteHub

Compare ViteHub primitives

Choose between ViteHub capabilities, orchestrators, interfaces, and shared state.

ViteHub packages solve different server-side jobs. Pick the primitive by the shape of the work first, then choose the provider page for your deployment target.

Use this page when you are deciding whether a feature should store state, store files, run outside the response path, run in isolation, coordinate a model loop, expose a chat interface, or stay inline in the request.

For the architecture behind these boundaries, read ViteHub philosophy.

Pick by outcome

You need toUseWhy
Read or write small JSON-like values by keyKVThe route needs fast key-based state without provider SDK code.
Accept, store, list, or stream filesBlobThe data is a file, stream, binary body, or object with metadata.
Return before background work finishesQueueThe request should enqueue work and let the provider deliver it outside the response path.
Coordinate durable steps, waits, retries, or resumable workWorkflowThe work needs orchestration beyond one request or one model call.
Run user-defined or risky code behind an isolated boundarySandboxThe work needs an execution boundary and a result payload.
Run a model/tool loopAgentThe feature needs model instructions, tools, and ViteHub message input.
Receive and respond to chat platform eventsChatThe feature needs Chat SDK adapters, webhook handling, and conversation state.
Persist conversation or stream state across interfacesMessagesAgent and chat need the same serializable message/event model.
Finish a small amount of work before respondingInline request codeThe work is quick, reliable, and belongs to the response path.
Query relationships, joins, transactions, or historyA databaseThe data has a relational or durable application model.
Choose the primitive for the runtime behavior you need. Provider setup comes after that choice: Cloudflare and Vercel pages explain bindings, tokens, buckets, topics, and deployment-specific checks.

Package fit

KV
Store small values, settings, cache entries, flags, and lookup tables by key.

::

Blob
Store uploads, generated assets, exports, images, and other file-shaped data.
Queue
Send emails, fan out webhook handling, run post-response work, and rely on provider delivery.
Workflow
Run durable server orchestration with resumable state and provider-backed execution.
Sandbox
Execute isolated jobs such as code evaluation, report generation, transforms, and agent tools.
Agent
Define model and tool-loop agents that consume canonical ViteHub messages.
Chat
Connect Chat SDK adapters, webhook routes, state, and optional agent handoff.
Messages
Share serializable message and stream-event state between chat, agent, and interfaces.

Common decisions

DecisionChoose this
Store a user avatar uploadBlob
Store the selected theme for a workspaceKV
Send a welcome email after signupQueue
Run an onboarding process that waits for provider callbacksWorkflow
Generate release notes from a request payload in an isolated runtimeSandbox
Answer a support question with tools and model instructionsAgent
Receive Slack, Discord, or Teams messages and respond in a threadChat
Save assistant stream events and replay them after reloadMessages
Increment a request-local counter before returning JSONInline request code
Store users, teams, permissions, and audit historyA database

Combine primitives

Many features use more than one primitive:

  1. Store upload metadata in KV and the file body in Blob.
  2. Accept a request, write a small status record to KV, then enqueue Queue work.
  3. Run a Sandbox job, store its output in Blob, and save the latest result key in KV.
  4. Let Chat adapt a direct message into Messages, then hand it to Agent.
  5. Let Workflow coordinate a long-running Agent task that uses Sandbox as a scoped capability.

Keep the public route small. It should validate input, call the primitive that owns the work, and return a result the client can handle.

Provider routing

Cloudflare
Configure bindings, buckets, queues, and sandbox provider requirements for Cloudflare deployments.
Vercel
Configure tokens, Upstash-backed KV, Vercel Blob, Vercel Queue, and Vercel Sandbox.
Copyright © 2026