Change a prompt without a deploy

Keep prompts in telemetry.dev with versions and labels. Your code fetches the version labeled production, and each trace shows which version ran.

Start tracing free

Your coding agent finds the prompts in your code, gives you each one to paste into telemetry.dev, and moves the code to getPrompt.

Promptssupport/refund-reply

production · v7Promote v8

gpt-4.1-minitemperature 0.2

system

You are the support agent for {{store_name}}. Refunds above {{refund_limit}} need a human.

user

Order {{order_id}}: {{customer_message}}

Test run
order_id
4471
customer_message
I was charged twice for the desk

v81.2s$0.0006

I see two charges of $389 for order 4471. I have refunded the second one; it reaches your card in 5 to 10 days.

Recorded as a trace

VersionChangeLabelSaved bySaved
v8Say so before you ask for the order number—Ana Ruiz2h ago
v7Ask for the order number firstproductionKofi MensahOct 21
v6Name the refund limit—Ana RuizOct 14
v5First version in telemetry.dev—Kofi MensahOct 9
VersionCallsErrorsp50Cost per call
v81,2040.4%1.1s$0.0006
v710,8811.9%1.4s$0.0009
v62,3102.2%1.5s$0.0009
v50———

Ship a version. Watch what it costs.

Labels decide which version your code gets. Move a label to part of the traffic first, then compare the versions on calls, errors, latency, and cost.

Give a new version 10% of the calls first

Promote a version to production for 1 to 99% of calls. If it goes wrong, move the label back to the last version.

Promote v8 to production
All callsPart of the calls

v8 gets10%

v8 · 10%v7 · 90%

− Refunds above {{refund_limit}} need a human.

+ Refunds above {{refund_limit}} need a human. Say so before you ask

+ for the order number.

Promote to 10%Cancel

See the version behind each answer

The model call carries the prompt name, version, and label. Filter traces by prompt.

chat gpt-4.1-mini1.16s

Prompt

Name
support/refund-reply
Version
v8
Label
production · 10%

Open in the editor

Output

I see two charges of $389 for order 4471…

Compare versions on real calls

Calls, errors, p50 latency, and cost per call for each version.

Metrics
VersionCallsErrorsp50Cost/call
v81,2040.4%1.1s$0.0006
v710,8811.9%1.4s$0.0009
v62,3102.2%1.5s$0.0009

Fetch the prompt in your code

The SDK gets the version that carries the label, fills in the variables, and records the prompt on the spans of the model call.

  1. 01Write and test the prompt
  2. 02Label a version production
  3. 03Fetch it in your code

Test runs use your own model key. The model calls of the telemetry.dev SDKs and provider integrations, such as OpenAI or Anthropic, record the prompt.

import { getPrompt, withPrompt } from "@telemetry-dev/sdk";

const prompt = await getPrompt("support/refund-reply", { label: "production" });
const messages = prompt.compile({ order_id, customer_message });
const reply = await withPrompt(prompt, () => callModel(messages));
from telemetry_dev import get_prompt, with_prompt

prompt = get_prompt("support/refund-reply", label="production")
messages = prompt.compile(order_id=order_id, customer_message=customer_message)

with with_prompt(prompt):
    reply = call_model(messages)
curl "https://api.telemetry.dev/v1/prompts?name=support/refund-reply&label=production" \
  -H "Authorization: Bearer $TELEMETRY_DEV_API_KEY"

Trace your next AI request

Choose an integration, add your project API key, and run an instrumented request.

Start free

30,000 ingestion units a month, one per span, log record, or metric data point. No credit card required.

npm install @telemetry-dev/sdk
Start tracing free

Talk to an engineer

Our team shows you tracing, cost tracking, and privacy controls for the frameworks and model providers that you use.

Book a call