Prompt Management
Oodle includes a Langfuse-compatible prompt management API. You can use the standard Langfuse SDK to create, version, label, and fetch prompts at runtime — no separate Langfuse deployment required.
Prompts are managed in the Oodle UI at GenAI >
Prompts (ap1, us1), where
you can edit content, assign labels like production
or staging, compare versions, and test in the
playground.
Getting Started
1. Install the Langfuse SDK
- Python
- JavaScript / TypeScript
pip install langfuse
npm install langfuse
2. Configure credentials
The SDK needs three values:
| Variable | Description |
|---|---|
LANGFUSE_SECRET_KEY | Your Oodle API key (from Settings > API Keys ap1, us1) |
LANGFUSE_HOST | https://<your-domain>/v1/api/instance/<instance>/langfuse |
LANGFUSE_PUBLIC_KEY | Set to "default" |
Set them as environment variables:
export LANGFUSE_HOST="https://<your-domain>/v1/api/instance/<instance>/langfuse"
export LANGFUSE_SECRET_KEY="<YOUR_API_KEY>"
export LANGFUSE_PUBLIC_KEY="default"
Or pass them when initializing the client:
- Python
- JavaScript / TypeScript
from langfuse import Langfuse
langfuse = Langfuse(
public_key="default",
secret_key="<YOUR_API_KEY>",
host="https://<your-domain>/v1/api/instance/<instance>/langfuse",
)
import Langfuse from "langfuse";
const langfuse = new Langfuse({
publicKey: "default",
secretKey: "<YOUR_API_KEY>",
baseUrl: "https://<your-domain>/v1/api/instance/<instance>/langfuse",
});
3. Create a prompt
Use {{variable}} syntax for template variables that
will be filled in at runtime:
- Python
- JavaScript / TypeScript
langfuse.create_prompt(
name="my-prompt",
prompt="You are a helpful assistant.\n{{user_input}}",
labels=["production"],
)
await langfuse.createPrompt({
name: "my-prompt",
prompt: "You are a helpful assistant.\n{{user_input}}",
labels: ["production"],
});
Each call creates a new version. The latest label
is automatically assigned to the newest version.
4. Fetch and compile a prompt
Fetch a prompt by name and label, then compile it with variable values:
- Python
- JavaScript / TypeScript
prompt = langfuse.get_prompt(
"my-prompt",
label="production",
)
compiled = prompt.compile(
user_input="What is observability?",
)
const prompt = await langfuse.getPrompt(
"my-prompt",
{ label: "production" },
);
const compiled = prompt.compile({
user_input: "What is observability?",
});
You can also fetch by specific version number:
- Python
- JavaScript / TypeScript
prompt = langfuse.get_prompt(
"my-prompt",
version=3,
)
const prompt = await langfuse.getPrompt(
"my-prompt",
{ version: 3 },
);
5. Verify in Oodle
Navigate to GenAI > Prompts (ap1, us1) to see your prompts, version history, and label assignments.
Labels
Labels let you control which version of a prompt is served in each environment without changing code.
| Label | Behavior |
|---|---|
latest | Auto-assigned to the newest version |
production | Typically used for live traffic |
Custom (e.g. staging, canary) | Any lowercase alphanumeric string with -, _, . |
Assign labels in the Oodle UI or via the SDK. When you
fetch a prompt with label="production", you always
get the version currently tagged with that label — no
redeployment needed to roll forward or back.
Prompt References
Prompts can reference other prompts using the
@@@oodlePrompt:name=<name>|label=<label>@@@ syntax.
When a prompt is fetched, Oodle resolves these
references recursively and returns the fully composed
content.
This lets you build modular prompt libraries — for example, a shared system instruction referenced by multiple task-specific prompts.
Managing Prompts in the UI
The Oodle UI at Agent Observability → Prompts (ap1, us1) provides a visual interface for managing prompts beyond what the SDK offers.
Prompt Types
Oodle supports two prompt types:
| Type | Description |
|---|---|
| Text | A single block of text with {{variable}} placeholders |
| Chat | A multi-message conversation with role selection (system, user, assistant) |
Choose the type when creating a new prompt. Chat prompts are useful for few-shot examples or multi-turn templates.
Folders
Organize prompts into folders for easier navigation. Create folders from the prompts list page and drag prompts between them.
Prompt Detail Page
Click any prompt to open its detail page with these tabs:
| Tab | Description |
|---|---|
| Prompt | View and edit the prompt content |
| Config | JSON model parameters (temperature, max tokens, etc.) |
| Use | SDK code snippets for fetching and compiling the prompt |
| Metrics | Usage metrics over a configurable time range |
Version History
The sidebar on the prompt detail page shows all versions. Click any version to view it, and use the diff dialog to compare two versions side by side.
Test in Playground
Click Test in Playground on any prompt to open the Playground with the prompt content pre-loaded. After iterating in the Playground, use Save as Prompt to save your changes back as a new prompt.
Best Practices
- Use labels for deploys. Fetch by label (not version number) in production code so you can update prompts without redeploying.
- Keep
productionstable. Test new versions with astagingorcanarylabel before promoting. - Use variables for dynamic content. Avoid
hardcoding user inputs or context into prompt text —
use
{{variable}}placeholders andcompile(). - Version intentionally. Each
create_promptcall creates a new version. Write a commit message to track why the prompt changed.
Support
If you need assistance or have any questions, please reach out to us through:
- Email at [email protected]