The Vercel AI SDK gives you generateText and streamText, but no place to store, version or roll back the prompt strings you pass them. So they end up as constants in your repository, and changing one sentence takes a commit, a build and a deploy. This guide moves a prompt out of the code: it lives in a dashboard, generateText receives it at runtime, and your app follows each change within a minute. PromptHelm's SDK is TypeScript, for Node.js 18 and later.
Does the Vercel AI SDK have prompt management?
No. The SDK calls the model; where the prompt text comes from is up to you. Most apps use one of three places, each with a cost:
- Constants in the code. Simple, and reviewed like code, but every edit is a deploy.
- Environment variables. On Vercel, a changed variable only applies to new deployments, so this is still a deploy, with no history, no diff and no rollback.
- Your own database table. Changes go live without a deploy, and you build the rest: an editor, versions, rollback, caching and a fallback for when the table can't be reached.
A prompt service answers one question, "which text is live for this slug?", so the code around your model call stays as it is.
What to look for in a prompt tool
| Ask for | Why it matters |
|---|---|
| Changes without a redeploy | The reason to move the prompt out of the code. |
| Versions that never change | You can tell which text gave an answer, and go back to it. |
| One-click rollback | A bad prompt is undone in seconds, not after a build. |
| A fallback when the service is down | A prompt store must never become a way for your app to fail. |
| Variables filled in on your server | Your users' data stays with you; the service only sees templates. |
| Pricing that doesn't grow with traffic | Fetching a prompt shouldn't cost more as your app gets busier. |
One more test: the call to the model should stay in your code, with your provider's key. A tool that proxies or logs your LLM requests sees your users' messages, and becomes another company to list in your security review.
Fetch a prompt and pass it to generateText
Install the SDK
npm install @prompt-helm/sdkIt has no dependencies, ships as ESM and CommonJS, and is MIT licensed.
Get the prompt, then call the model
import { anthropic } from "@ai-sdk/anthropic";
import { PromptHelm } from "@prompt-helm/sdk";
import { generateText } from "ai";
// One client for the whole app: it holds the cache. Reads PROMPTHELM_API_KEY.
const ph = new PromptHelm();
export async function replyToTicket(customerName: string, ticket: string) {
const instructions = await ph.get("support-reply", {
vars: { customer_name: customerName },
fallback: "Reply to {{customer_name}} kindly, in two short paragraphs.",
});
const { text } = await generateText({
model: anthropic("claude-sonnet-5-5"),
instructions,
prompt: ticket,
});
return text;
}"support-reply"is the slug: the name the code asks for, set when you create the prompt in the dashboard.varsfills each{{customer_name}}in the stored prompt. The SDK does it on your server, so the customer's name never reaches PromptHelm. If the live version needs a variable your code doesn't pass,getreturns the fallback rather than a half-filled prompt.fallbackis the prompt you had hard-coded. It's what your app sends when PromptHelm can't answer, so make it a real, working prompt.generateTextis called by your own code with your own key. The AI SDK takes a system prompt as instructions, and any provider works the same way.
Let the dashboard choose the model too
A version can also carry the model to call it with, its temperature and its output limit.resolve returns them as config, with only the ones you set, so your defaults stay in the code:
const r = await ph.resolve("support-reply", {
vars: { customer_name: customerName },
fallback: "Reply to {{customer_name}} kindly, in two short paragraphs.",
});
const { text } = await generateText({
model: anthropic(r.config.model ?? "claude-sonnet-5-5"),
temperature: r.config.temperature,
maxOutputTokens: r.config.maxTokens,
instructions: r.text,
prompt: ticket,
});Moving to a cheaper model is then a publish: it rolls back in one click, and an A/B test can tell whether it does as well. The model's name isn't checked with your provider, so try a new one on a share of calls first.
What happens when you publish
You edit the prompt in the dashboard, review the change word by word, and publish. The published text becomes a numbered version that never changes.
Running apps pick it up on their next refresh. The SDK serves each prompt from memory for 60 seconds by default, then refreshes it in the background, so after the first fetch no request waits on PromptHelm. The prompt's page shows which API key was last served which version, so you can see the change reach your apps.
Keeping your app up if the prompt service fails
Fallback and timeout
A request gets 3 seconds. A timeout, a network error, a bad key, a missing prompt and a missing variable all take the same path: get returns your fallback and calls onError, so you can log why. Without a fallback, it throws instead. The SDK also tells PromptHelm the error's code, so the prompt's page shows which app fell back; pass reportFallbacks: false to turn that off.
Stale while revalidating
Once a prompt is cached, a failed background refresh keeps serving the last good version and tries again after one ttl. The fallback matters most on a cold instance, before its first fetch, which is why it should be a prompt you'd happily ship.
To keep fallbacks from drifting, write every published prompt to a file in CI and pass it as the fallback:
npx @prompt-helm/sdk pull --out src/prompthelm.fallbacks.tsimport { fallbacks } from "./prompthelm.fallbacks";
const instructions = await ph.get("support-reply", {
vars: { customer_name: customerName },
fallback: fallbacks["support-reply"],
});Serverless notes
The cache lives in memory, one per instance. On Vercel each function instance fetches the prompt once and refreshes it on its own schedule, so a change reaches instances one by one within a ttl. The SDK is tested on Node.js 18 and later; it uses only fetch, but other runtimes aren't tested.
Roll back a bad prompt in one click
Rolling back makes an older version live again: it moves a pointer and rewrites nothing. Published by mistake? Undo is offered right after. Apps follow on their next refresh, the same way they followed the publish. Compare that with a revert, a build and a deploy while customers read the bad reply. More in prompt versioning and rollback.
Using it from a service that isn't TypeScript
It's one HTTP request: GET /v1/prompts/:slug with a read-only API key. Send the ETag back as If-None-Match and you get an empty 304 until something changes. There's no Python SDK today; Python services use the HTTP API, which the quickstart shows.
Set it up with Cursor or Claude Code
Paste this into your coding agent. It points the agent at the quickstart in Markdown, which has notes written for agents; /llms.txt sums PromptHelm up.
Or hand it to your coding agent
Paste this into Claude Code, Cursor or any agent that edits your repository.
Move this app's hard-coded LLM prompts to PromptHelm…
Then create each prompt in the dashboard under the slug the agent used, with the old text as v1.
What PromptHelm doesn't do
It does one job: live prompt changes. It has no staging and production environments (one project per environment is the way today), no playground, no evals or A/B tests, no team seats, no tracing of your LLM calls, and no API to write prompts: they're published in the dashboard. The SDK is TypeScript only. If you need those, this is the wrong tool; if you need prompts that change without a deploy, it's the lighter one. And your prompts aren't locked in: Settings exports a project, every version included, as JSON.
Pricing
Free covers 10 prompts and 2 projects, with no card. Pro is $19 a month or $190 a year for 200 prompts and unlimited projects. Requests are never billed, so a busier app doesn't change the invoice. See pricing.
Questions
Does the Vercel AI SDK have built-in prompt management?
No. It calls models and streams their output, but it doesn't store, version or roll back the prompts you pass it. They live wherever your code keeps them: in the code, in environment variables, in a database, or in a prompt service.
How do I change a prompt without redeploying on Vercel?
Fetch it at runtime instead of bundling it. With PromptHelm, ph.get("slug", { vars, fallback }) returns the live text, and a published change reaches each running instance on its next refresh, within 60 seconds by default.
Can I keep prompts in environment variables?
You can, but on Vercel a changed environment variable only applies to new deployments, so every change is still a deploy, and you get no version history, diff or rollback.
Will a prompt service slow down or break my app?
Not with a cache and a fallback. The SDK serves prompts from memory after the first fetch and refreshes them in the background, gives up on a request after 3 seconds, and returns your fallback on any failure, telling onError why.
Does PromptHelm see my users' data or my model provider's key?
No. Your code calls the model with your own key, and the SDK fills in variables on your server. PromptHelm answers which text is live for a slug; when your app falls back, the SDK tells it the error code, never the text or any value.
Does it work with streamText and other providers?
Yes. The prompt arrives as a string, so it goes wherever the AI SDK takes one, such as instructions or prompt in generateText and streamText, with any provider.
Is there a Python SDK?
Not yet. A Python service fetches the live version with one HTTP request and a read-only API key; the quickstart shows how.
How much does it cost?
Free covers 10 prompts and 2 projects, with no card. Pro is $19 a month or $190 a year for 200 prompts and unlimited projects. Requests are never billed. See pricing.