Skip to main content

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

pip install langfuse

2. Configure credentials

The SDK needs three values:

VariableDescription
LANGFUSE_SECRET_KEYYour Oodle API key (from Settings > API Keys ap1, us1)
LANGFUSE_HOSThttps://<your-domain>/v1/api/instance/<instance>/langfuse
LANGFUSE_PUBLIC_KEYSet 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:

from langfuse import Langfuse

langfuse = Langfuse(
public_key="default",
secret_key="<YOUR_API_KEY>",
host="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:

langfuse.create_prompt(
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:

prompt = langfuse.get_prompt(
"my-prompt",
label="production",
)

compiled = prompt.compile(
user_input="What is observability?",
)

You can also fetch by specific version number:

prompt = langfuse.get_prompt(
"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.

LabelBehavior
latestAuto-assigned to the newest version
productionTypically 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.

Best Practices

  • Use labels for deploys. Fetch by label (not version number) in production code so you can update prompts without redeploying.
  • Keep production stable. Test new versions with a staging or canary label before promoting.
  • Use variables for dynamic content. Avoid hardcoding user inputs or context into prompt text — use {{variable}} placeholders and compile().
  • Version intentionally. Each create_prompt call 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: