Using Langfuse Prompt Management with Bedrock Invoke Model instead of Converse API #10518
Replies: 2 comments
|
Based on the available documentation, I don't see specific information about configuring Langfuse's Prompt Management UI or Playground to use Bedrock's Invoke Model API instead of the Converse API. However, you can work around this by using Langfuse Prompt Management via the SDK for your experiments(1)(2). Here's how: SDK-Based Approach1. Fetch prompts from Langfuse: from langfuse import get_client
# Initialize Langfuse client
langfuse = get_client()
# Get current production version of a chat prompt
chat_prompt = langfuse.get_prompt("movie-critic-chat", type="chat")
# Insert variables into chat prompt template
compiled_chat_prompt = chat_prompt.compile(criticlevel="expert", movie="Dune 2")2. Run experiments programmatically with your Bedrock Invoke Model logic: The Experiments via SDK approach gives you full flexibility to use your own application logic(2). You can: from langfuse import get_client
from langfuse.openai import OpenAI
# Initialize clientThen implement your custom task function that uses Bedrock's Invoke Model API instead of Converse, while still leveraging Langfuse's experiment runner for tracing and evaluation(2). Key advantages of this approach:
The prompt object structure supports both text and chat formats(3), and you can store any parameters in the optional For additional resources on Bedrock integration, see the Amazon Bedrock Integration guide(4). ** 📚 Sources:
Have another question? Just tag @inkeep. |
|
Hi @mohamedkhalilbeldi, as far as I am aware, you can't choose this in the UI. However, you should be able to enforce this by setting up an experiment run via the SDK: https://langfuse.com/docs/evaluation/experiments/experiments-via-sdk Let me know if that works! |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I’m working on a chatbot app with AWS Bedrock, where we use Invoke Model rather than the Converse API.
I’ve successfully implemented tracing. However, when I tried to use the Langfuse Prompt Management module, I noticed that it natively defaults to the Converse API—for example, when running experimental prompts.
My questions are:
Is there a way to configure Langfuse UI to use Invoke Model for prompt management when running experiments?
If not, is there a way to use Invoke Model to run experimental prompt management via the SDK instead of the UI?
All reactions