Support Amazon Nova models #9127
brianprost
started this conversation in
Ideas
Replies: 1 comment · 1 reply
-
Can you share an example trace by any chance? Langfuse captures metadata that is emitted by the frameworks that you mention. It might be the case that they all have a somewhat worse support for Nova models than for others. |
Beta Was this translation helpful? Give feedback.
All reactions
1 reply
-
Hey @marcklingen, sure! Attached two traces. One is from Nova, one Claude Sonnet 4. Ran them back to back with the following Python code in Strands Agents. Claude Sonnet 4{
"trace": {
"id": "a2aef0e69b6a7e332f6b67873dc54fc5",
"projectId": "cmfa93xfb00x8ad073r5p89og",
"name": "invoke_agent Strands Agents",
"timestamp": "2025-09-18T02:16:05.206Z",
"environment": "default",
"tags": [
"nova-demo"
],
"bookmarked": false,
"release": null,
"version": "1.9.0",
"userId": "[email protected]",
"sessionId": "electric-boogaloo-1",
"public": false,
"input": "\"[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"[{\\\\\\\"text\\\\\\\": \\\\\\\"<topic>OpenTelemetry</topic>\\\\\\\"}]\\\"}]\"",
"output": "\"{\\\"message\\\":\\\"Why did the OpenTelemetry engineer break up with their significant other?\\\\n\\\\nBecause they said the relationship lacked proper *observability* - there were no traces of affection, the metrics were all over the place, and the logs showed nothing but errors! \\\\n\\\\nPlus, every time they tried to have a heart-to-heart conversation, their partner would just respond with \\\\\\\"span not found\\\\\\\" and refuse to propagate the context. \\\\n\\\\nThe final straw was when they realized their love life had become a distributed system with no instrumentation - they could never tell if the connection was healthy or if they were just dealing with silent failures!\\\\n\\\\n*adjusts glasses and grins proudly while the room fills with collective groans from seasoned SREs and observability engineers*\\\\n\\\",\\\"finish_reason\\\":\\\"end_turn\\\"}\"",
"metadata": "{\"attributes\":{\"gen_ai.event.start_time\":\"2025-09-18T02:16:05.206143+00:00\",\"gen_ai.system\":\"strands-agents\",\"gen_ai.agent.name\":\"Strands Agents\",\"gen_ai.operation.name\":\"invoke_agent\",\"gen_ai.request.model\":\"us.anthropic.claude-sonnet-4-20250514-v1:0\",\"session.id\":\"electric-boogaloo-1\",\"user.id\":\"[email protected]\",\"langfuse.tags\":\"[\\\"nova-demo\\\"]\",\"system_prompt\":\"tell the most terribly cheesy dad joke of all time given a user's topic. assume that the audience is a group of experts on the given topic, and would appreciate nuance. pay lots of attention to the user's topic. it will be provided to you between appropriate XML tags.\",\"gen_ai.event.end_time\":\"2025-09-18T02:16:11.223892+00:00\",\"gen_ai.usage.prompt_tokens\":\"77\",\"gen_ai.usage.completion_tokens\":\"165\",\"gen_ai.usage.input_tokens\":\"77\",\"gen_ai.usage.output_tokens\":\"165\",\"gen_ai.usage.total_tokens\":\"242\",\"gen_ai.usage.cache_read_input_tokens\":\"0\",\"gen_ai.usage.cache_write_input_tokens\":\"0\"},\"resourceAttributes\":{\"telemetry.sdk.language\":\"python\",\"telemetry.sdk.name\":\"opentelemetry\",\"telemetry.sdk.version\":\"1.37.0\",\"service.name\":\"strands-agents\",\"service.version\":\"1.9.0\"},\"scope\":{\"name\":\"strands.telemetry.tracer\",\"attributes\":{}}}",
"createdAt": "2025-09-18T02:16:10.000Z",
"updatedAt": "2025-09-18T02:16:11.436Z",
"scores": [],
"latency": 6.017,
"observations": [
{
"id": "9bce136fd5f721c7",
"traceId": "a2aef0e69b6a7e332f6b67873dc54fc5",
"projectId": "cmfa93xfb00x8ad073r5p89og",
"type": "AGENT",
"environment": "default",
"parentObservationId": null,
"startTime": "2025-09-18T02:16:05.206Z",
"endTime": "2025-09-18T02:16:11.223Z",
"name": "invoke_agent Strands Agents",
"metadata": "{}",
"level": "DEFAULT",
"statusMessage": null,
"version": "1.9.0",
"modelParameters": {},
"completionStartTime": null,
"promptId": null,
"createdAt": "2025-09-18T02:16:11.366Z",
"updatedAt": "2025-09-18T02:16:11.366Z",
"usageDetails": {
"input": 77,
"output": 165,
"total": 242,
"cache_read_input_tokens": 0,
"cache_write_input_tokens": 0
},
"costDetails": {
"input": 0.000231,
"output": 0.002475,
"cache_read_input_tokens": 0,
"total": 0.002706
},
"providedCostDetails": {},
"model": "us.anthropic.claude-sonnet-4-20250514-v1:0",
"internalModelId": "cmazmkzlm00000djp1e1qe4k4",
"promptName": null,
"promptVersion": null,
"latency": 6017,
"timeToFirstToken": null,
"inputCost": 0.000231,
"outputCost": 0.002475,
"totalCost": 0.002706,
"inputUsage": 77,
"outputUsage": 165,
"totalUsage": 242
},
{
"id": "de6d9cef6aa5d46a",
"traceId": "a2aef0e69b6a7e332f6b67873dc54fc5",
"projectId": "cmfa93xfb00x8ad073r5p89og",
"type": "SPAN",
"environment": "default",
"parentObservationId": "9bce136fd5f721c7",
"startTime": "2025-09-18T02:16:05.206Z",
"endTime": "2025-09-18T02:16:11.089Z",
"name": "execute_event_loop_cycle",
"metadata": "{}",
"level": "DEFAULT",
"statusMessage": null,
"version": "1.9.0",
"modelParameters": null,
"completionStartTime": null,
"promptId": null,
"createdAt": "2025-09-18T02:16:11.214Z",
"updatedAt": "2025-09-18T02:16:11.214Z",
"usageDetails": {},
"costDetails": {},
"providedCostDetails": {},
"model": null,
"internalModelId": null,
"promptName": null,
"promptVersion": null,
"latency": 5883,
"timeToFirstToken": null,
"inputCost": null,
"outputCost": null,
"totalCost": 0,
"inputUsage": 0,
"outputUsage": 0,
"totalUsage": 0
},
{
"id": "fe5fb153f08feb8f",
"traceId": "a2aef0e69b6a7e332f6b67873dc54fc5",
"projectId": "cmfa93xfb00x8ad073r5p89og",
"type": "GENERATION",
"environment": "default",
"parentObservationId": "de6d9cef6aa5d46a",
"startTime": "2025-09-18T02:16:05.206Z",
"endTime": "2025-09-18T02:16:09.526Z",
"name": "chat",
"metadata": "{}",
"level": "DEFAULT",
"statusMessage": null,
"version": "1.9.0",
"modelParameters": {},
"completionStartTime": null,
"promptId": null,
"createdAt": "2025-09-18T02:16:09.718Z",
"updatedAt": "2025-09-18T02:16:09.718Z",
"usageDetails": {
"input": 77,
"output": 165,
"total": 242,
"cache_read_input_tokens": 0,
"cache_write_input_tokens": 0
},
"costDetails": {
"input": 0.000231,
"output": 0.002475,
"cache_read_input_tokens": 0,
"total": 0.002706
},
"providedCostDetails": {},
"model": "us.anthropic.claude-sonnet-4-20250514-v1:0",
"internalModelId": "cmazmkzlm00000djp1e1qe4k4",
"promptName": null,
"promptVersion": null,
"latency": 4320,
"timeToFirstToken": null,
"inputCost": 0.000231,
"outputCost": 0.002475,
"totalCost": 0.002706,
"inputUsage": 77,
"outputUsage": 165,
"totalUsage": 242
}
]
},
"observations": [
{
"id": "9bce136fd5f721c7",
"traceId": "a2aef0e69b6a7e332f6b67873dc54fc5",
"projectId": "cmfa93xfb00x8ad073r5p89og",
"type": "AGENT",
"environment": "default",
"parentObservationId": null,
"startTime": "2025-09-18T02:16:05.206Z",
"endTime": "2025-09-18T02:16:11.223Z",
"name": "invoke_agent Strands Agents",
"metadata": "{}",
"level": "DEFAULT",
"statusMessage": null,
"version": "1.9.0",
"modelParameters": {},
"completionStartTime": null,
"promptId": null,
"createdAt": "2025-09-18T02:16:11.366Z",
"updatedAt": "2025-09-18T02:16:11.366Z",
"usageDetails": {
"input": 77,
"output": 165,
"total": 242,
"cache_read_input_tokens": 0,
"cache_write_input_tokens": 0
},
"costDetails": {
"input": 0.000231,
"output": 0.002475,
"cache_read_input_tokens": 0,
"total": 0.002706
},
"providedCostDetails": {},
"model": "us.anthropic.claude-sonnet-4-20250514-v1:0",
"internalModelId": "cmazmkzlm00000djp1e1qe4k4",
"promptName": null,
"promptVersion": null,
"latency": 6017,
"timeToFirstToken": null,
"inputCost": 0.000231,
"outputCost": 0.002475,
"totalCost": 0.002706,
"inputUsage": 77,
"outputUsage": 165,
"totalUsage": 242
},
{
"id": "de6d9cef6aa5d46a",
"traceId": "a2aef0e69b6a7e332f6b67873dc54fc5",
"projectId": "cmfa93xfb00x8ad073r5p89og",
"type": "SPAN",
"environment": "default",
"parentObservationId": "9bce136fd5f721c7",
"startTime": "2025-09-18T02:16:05.206Z",
"endTime": "2025-09-18T02:16:11.089Z",
"name": "execute_event_loop_cycle",
"metadata": "{}",
"level": "DEFAULT",
"statusMessage": null,
"version": "1.9.0",
"modelParameters": null,
"completionStartTime": null,
"promptId": null,
"createdAt": "2025-09-18T02:16:11.214Z",
"updatedAt": "2025-09-18T02:16:11.214Z",
"usageDetails": {},
"costDetails": {},
"providedCostDetails": {},
"model": null,
"internalModelId": null,
"promptName": null,
"promptVersion": null,
"latency": 5883,
"timeToFirstToken": null,
"inputCost": null,
"outputCost": null,
"totalCost": 0,
"inputUsage": 0,
"outputUsage": 0,
"totalUsage": 0
},
{
"id": "fe5fb153f08feb8f",
"traceId": "a2aef0e69b6a7e332f6b67873dc54fc5",
"projectId": "cmfa93xfb00x8ad073r5p89og",
"type": "GENERATION",
"environment": "default",
"parentObservationId": "de6d9cef6aa5d46a",
"startTime": "2025-09-18T02:16:05.206Z",
"endTime": "2025-09-18T02:16:09.526Z",
"name": "chat",
"metadata": "{}",
"level": "DEFAULT",
"statusMessage": null,
"version": "1.9.0",
"modelParameters": {},
"completionStartTime": null,
"promptId": null,
"createdAt": "2025-09-18T02:16:09.718Z",
"updatedAt": "2025-09-18T02:16:09.718Z",
"usageDetails": {
"input": 77,
"output": 165,
"total": 242,
"cache_read_input_tokens": 0,
"cache_write_input_tokens": 0
},
"costDetails": {
"input": 0.000231,
"output": 0.002475,
"cache_read_input_tokens": 0,
"total": 0.002706
},
"providedCostDetails": {},
"model": "us.anthropic.claude-sonnet-4-20250514-v1:0",
"internalModelId": "cmazmkzlm00000djp1e1qe4k4",
"promptName": null,
"promptVersion": null,
"latency": 4320,
"timeToFirstToken": null,
"inputCost": 0.000231,
"outputCost": 0.002475,
"totalCost": 0.002706,
"inputUsage": 77,
"outputUsage": 165,
"totalUsage": 242
}
]
} Amazon Nova Premier{
"trace": {
"id": "1e1423e5e06dad1b0e09295bee830785",
"projectId": "cmfa93xfb00x8ad073r5p89og",
"name": "invoke_agent Strands Agents",
"timestamp": "2025-09-18T02:15:33.629Z",
"environment": "default",
"tags": [
"nova-demo"
],
"bookmarked": false,
"release": null,
"version": "1.9.0",
"userId": "[email protected]",
"sessionId": "electric-boogaloo-1",
"public": false,
"input": "\"[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"[{\\\\\\\"text\\\\\\\": \\\\\\\"<topic>OpenTelemetry</topic>\\\\\\\"}]\\\"}]\"",
"output": "\"{\\\"message\\\":\\\"Alright, brace yourselves for a dad joke that's finely tuned for OpenTelemetry connoisseurs:\\\\n\\\\nWhy did the OpenTelemetry trace break up with the metric?\\\\n\\\\nBecause it said, \\\\\\\"I need some space to find my own path, and honestly, you're just too aggregated for my distributed taste!\\\\\\\"\\\\n\\\\nBut don't worry, they reconciled over a mutual love for observability and now they're monitoring their relationship status in real-time dashboards! \\\\n\\\\nHope that tickled your fancy, even for the seasoned OpenTelemetry experts in the room!\\\\n\\\",\\\"finish_reason\\\":\\\"end_turn\\\"}\"",
"metadata": "{\"attributes\":{\"gen_ai.event.start_time\":\"2025-09-18T02:15:33.629385+00:00\",\"gen_ai.system\":\"strands-agents\",\"gen_ai.agent.name\":\"Strands Agents\",\"gen_ai.operation.name\":\"invoke_agent\",\"gen_ai.request.model\":\"us.amazon.nova-premier-v1:0\",\"session.id\":\"electric-boogaloo-1\",\"user.id\":\"[email protected]\",\"langfuse.tags\":\"[\\\"nova-demo\\\"]\",\"system_prompt\":\"tell the most terribly cheesy dad joke of all time given a user's topic. assume that the audience is a group of experts on the given topic, and would appreciate nuance. pay lots of attention to the user's topic. it will be provided to you between appropriate XML tags.\",\"gen_ai.event.end_time\":\"2025-09-18T02:15:37.627597+00:00\",\"gen_ai.usage.prompt_tokens\":\"66\",\"gen_ai.usage.completion_tokens\":\"116\",\"gen_ai.usage.input_tokens\":\"66\",\"gen_ai.usage.output_tokens\":\"116\",\"gen_ai.usage.total_tokens\":\"182\",\"gen_ai.usage.cache_read_input_tokens\":\"0\",\"gen_ai.usage.cache_write_input_tokens\":\"0\"},\"resourceAttributes\":{\"telemetry.sdk.language\":\"python\",\"telemetry.sdk.name\":\"opentelemetry\",\"telemetry.sdk.version\":\"1.37.0\",\"service.name\":\"strands-agents\",\"service.version\":\"1.9.0\"},\"scope\":{\"name\":\"strands.telemetry.tracer\",\"attributes\":{}}}",
"createdAt": "2025-09-18T02:15:38.000Z",
"updatedAt": "2025-09-18T02:15:37.846Z",
"scores": [],
"latency": 3.998,
"observations": [
{
"id": "d79e06a73fb9a324",
"traceId": "1e1423e5e06dad1b0e09295bee830785",
"projectId": "cmfa93xfb00x8ad073r5p89og",
"type": "AGENT",
"environment": "default",
"parentObservationId": null,
"startTime": "2025-09-18T02:15:33.629Z",
"endTime": "2025-09-18T02:15:37.627Z",
"name": "invoke_agent Strands Agents",
"metadata": "{}",
"level": "DEFAULT",
"statusMessage": null,
"version": "1.9.0",
"modelParameters": {},
"completionStartTime": null,
"promptId": null,
"createdAt": "2025-09-18T02:15:37.772Z",
"updatedAt": "2025-09-18T02:15:37.772Z",
"usageDetails": {
"input": 66,
"output": 116,
"total": 182,
"cache_read_input_tokens": 0,
"cache_write_input_tokens": 0
},
"costDetails": {},
"providedCostDetails": {},
"model": "us.amazon.nova-premier-v1:0",
"internalModelId": null,
"promptName": null,
"promptVersion": null,
"latency": 3998,
"timeToFirstToken": null,
"inputCost": null,
"outputCost": null,
"totalCost": 0,
"inputUsage": 66,
"outputUsage": 116,
"totalUsage": 182
},
{
"id": "000ecbbb77fd6f7f",
"traceId": "1e1423e5e06dad1b0e09295bee830785",
"projectId": "cmfa93xfb00x8ad073r5p89og",
"type": "SPAN",
"environment": "default",
"parentObservationId": "d79e06a73fb9a324",
"startTime": "2025-09-18T02:15:33.629Z",
"endTime": "2025-09-18T02:15:37.481Z",
"name": "execute_event_loop_cycle",
"metadata": "{}",
"level": "DEFAULT",
"statusMessage": null,
"version": "1.9.0",
"modelParameters": null,
"completionStartTime": null,
"promptId": null,
"createdAt": "2025-09-18T02:15:37.599Z",
"updatedAt": "2025-09-18T02:15:37.600Z",
"usageDetails": {},
"costDetails": {},
"providedCostDetails": {},
"model": null,
"internalModelId": null,
"promptName": null,
"promptVersion": null,
"latency": 3852,
"timeToFirstToken": null,
"inputCost": null,
"outputCost": null,
"totalCost": 0,
"inputUsage": 0,
"outputUsage": 0,
"totalUsage": 0
},
{
"id": "081999bdb2991e1c",
"traceId": "1e1423e5e06dad1b0e09295bee830785",
"projectId": "cmfa93xfb00x8ad073r5p89og",
"type": "GENERATION",
"environment": "default",
"parentObservationId": "000ecbbb77fd6f7f",
"startTime": "2025-09-18T02:15:33.629Z",
"endTime": "2025-09-18T02:15:37.304Z",
"name": "chat",
"metadata": "{}",
"level": "DEFAULT",
"statusMessage": null,
"version": "1.9.0",
"modelParameters": {},
"completionStartTime": null,
"promptId": null,
"createdAt": "2025-09-18T02:15:37.446Z",
"updatedAt": "2025-09-18T02:15:37.446Z",
"usageDetails": {
"input": 66,
"output": 116,
"total": 182,
"cache_read_input_tokens": 0,
"cache_write_input_tokens": 0
},
"costDetails": {},
"providedCostDetails": {},
"model": "us.amazon.nova-premier-v1:0",
"internalModelId": null,
"promptName": null,
"promptVersion": null,
"latency": 3675,
"timeToFirstToken": null,
"inputCost": null,
"outputCost": null,
"totalCost": 0,
"inputUsage": 66,
"outputUsage": 116,
"totalUsage": 182
}
]
},
"observations": [
{
"id": "d79e06a73fb9a324",
"traceId": "1e1423e5e06dad1b0e09295bee830785",
"projectId": "cmfa93xfb00x8ad073r5p89og",
"type": "AGENT",
"environment": "default",
"parentObservationId": null,
"startTime": "2025-09-18T02:15:33.629Z",
"endTime": "2025-09-18T02:15:37.627Z",
"name": "invoke_agent Strands Agents",
"metadata": "{}",
"level": "DEFAULT",
"statusMessage": null,
"version": "1.9.0",
"modelParameters": {},
"completionStartTime": null,
"promptId": null,
"createdAt": "2025-09-18T02:15:37.772Z",
"updatedAt": "2025-09-18T02:15:37.772Z",
"usageDetails": {
"input": 66,
"output": 116,
"total": 182,
"cache_read_input_tokens": 0,
"cache_write_input_tokens": 0
},
"costDetails": {},
"providedCostDetails": {},
"model": "us.amazon.nova-premier-v1:0",
"internalModelId": null,
"promptName": null,
"promptVersion": null,
"latency": 3998,
"timeToFirstToken": null,
"inputCost": null,
"outputCost": null,
"totalCost": 0,
"inputUsage": 66,
"outputUsage": 116,
"totalUsage": 182
},
{
"id": "000ecbbb77fd6f7f",
"traceId": "1e1423e5e06dad1b0e09295bee830785",
"projectId": "cmfa93xfb00x8ad073r5p89og",
"type": "SPAN",
"environment": "default",
"parentObservationId": "d79e06a73fb9a324",
"startTime": "2025-09-18T02:15:33.629Z",
"endTime": "2025-09-18T02:15:37.481Z",
"name": "execute_event_loop_cycle",
"metadata": "{}",
"level": "DEFAULT",
"statusMessage": null,
"version": "1.9.0",
"modelParameters": null,
"completionStartTime": null,
"promptId": null,
"createdAt": "2025-09-18T02:15:37.599Z",
"updatedAt": "2025-09-18T02:15:37.600Z",
"usageDetails": {},
"costDetails": {},
"providedCostDetails": {},
"model": null,
"internalModelId": null,
"promptName": null,
"promptVersion": null,
"latency": 3852,
"timeToFirstToken": null,
"inputCost": null,
"outputCost": null,
"totalCost": 0,
"inputUsage": 0,
"outputUsage": 0,
"totalUsage": 0
},
{
"id": "081999bdb2991e1c",
"traceId": "1e1423e5e06dad1b0e09295bee830785",
"projectId": "cmfa93xfb00x8ad073r5p89og",
"type": "GENERATION",
"environment": "default",
"parentObservationId": "000ecbbb77fd6f7f",
"startTime": "2025-09-18T02:15:33.629Z",
"endTime": "2025-09-18T02:15:37.304Z",
"name": "chat",
"metadata": "{}",
"level": "DEFAULT",
"statusMessage": null,
"version": "1.9.0",
"modelParameters": {},
"completionStartTime": null,
"promptId": null,
"createdAt": "2025-09-18T02:15:37.446Z",
"updatedAt": "2025-09-18T02:15:37.446Z",
"usageDetails": {
"input": 66,
"output": 116,
"total": 182,
"cache_read_input_tokens": 0,
"cache_write_input_tokens": 0
},
"costDetails": {},
"providedCostDetails": {},
"model": "us.amazon.nova-premier-v1:0",
"internalModelId": null,
"promptName": null,
"promptVersion": null,
"latency": 3675,
"timeToFirstToken": null,
"inputCost": null,
"outputCost": null,
"totalCost": 0,
"inputUsage": 66,
"outputUsage": 116,
"totalUsage": 182
}
]
} Python codeimport os
import base64
from strands import Agent
from strands.models import BedrockModel
from strands.telemetry import StrandsTelemetry
from dotenv import load_dotenv
load_dotenv()
# Build Basic Auth header.
LANGFUSE_AUTH = base64.b64encode(
f"{os.environ.get('LANGFUSE_PUBLIC_KEY')}:{os.environ.get('LANGFUSE_SECRET_KEY')}".encode()
).decode()
# Configure OpenTelemetry endpoint & headers
os.environ["OTEL_EXPORTER_OTLP_ENDPOINT"] = (
f"{os.environ.get('LANGFUSE_HOST')}/api/public/otel"
)
os.environ["OTEL_EXPORTER_OTLP_HEADERS"] = f"Authorization=Basic {LANGFUSE_AUTH}"
def main():
model = BedrockModel(model_id="us.anthropic.claude-sonnet-4-20250514-v1:0")
strands_telemetry = StrandsTelemetry().setup_otlp_exporter()
agent = Agent(
model=model,
system_prompt="tell the most terribly cheesy dad joke of all time given a user's topic. assume that the audience is a group of experts on the given topic, and would appreciate nuance. pay lots of attention to the user's topic. it will be provided to you between appropriate XML tags.",
trace_attributes={
"session.id": "electric-boogaloo-1",
"user.id": "[email protected]",
"langfuse.tags": ["nova-demo"],
},
)
agent("<topic>OpenTelemetry</topic>")
if __name__ == "__main__":
main()
|
Beta Was this translation helpful? Give feedback.
All reactions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature or potential improvement
Langfuse is already able to support limited tracing of the Amazon Nova models, but does not support as rich of metadata support when compared to most other models from Amazon Bedrock.
This is consistent throughout different frameworks/integrations. I’ve tried on AI SDK, Mastra, and Strands Agents and observed the same results across all.
I suspect that this is because there is no entry for the models in the constants file.
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions