Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

25.7 KB
Raw Blame
{
  "resourceSpans": [
    {
      "resource": {
        "attributes": [
          {
            "key": "telemetry.sdk.language",
            "value": {
              "stringValue": "python"
            }
          },
          {
            "key": "telemetry.sdk.name",
            "value": {
              "stringValue": "opentelemetry"
            }
          },
          {
            "key": "telemetry.sdk.version",
            "value": {
              "stringValue": "1.45.0"
            }
          },
          {
            "key": "service.instance.id",
            "value": {
              "stringValue": "c949636c-f59d-48d0-8239-a92b83ddc0ff"
            }
          },
          {
            "key": "telemetry.auto.version",
            "value": {
              "stringValue": "0.66b0"
            }
          },
          {
            "key": "service.name",
            "value": {
              "stringValue": "unknown_service:python3"
            }
          }
        ]
      },
      "scopeSpans": [
        {
          "scope": {
            "name": "litellm.gateway.client"
          },
          "spans": [
            {
              "traceId": "233c54429123cf3eecb0c0cdd275daea",
              "spanId": "649da60c202b3c6e",
              "parentSpanId": "251f89cfa368db92",
              "name": "gateway.request",
              "kind": 3,
              "startTimeUnixNano": "1791061358177721000",
              "endTimeUnixNano": "1791061361394236000",
              "attributes": [
                {
                  "key": "litellm.gateway.attempt",
                  "value": {
                    "boolValue": true
                  }
                },
                {
                  "key": "http.request.method",
                  "value": {
                    "stringValue": "POST"
                  }
                },
                {
                  "key": "url.full",
                  "value": {
                    "stringValue": "http://localhost:4002/v1/chat/completions"
                  }
                },
                {
                  "key": "server.address",
                  "value": {
                    "stringValue": "localhost"
                  }
                },
                {
                  "key": "http.response.status_code",
                  "value": {
                    "intValue": "200"
                  }
                },
                {
                  "key": "litellm.call_id",
                  "value": {
                    "stringValue": "b7d9d8c9-6c02-4b60-bea6-f706d8539157"
                  }
                }
              ],
              "status": {},
              "flags": 256
            }
          ]
        },
        {
          "scope": {
            "name": "openinference.instrumentation.openai",
            "version": "0.1.63"
          },
          "spans": [
            {
              "traceId": "233c54429123cf3eecb0c0cdd275daea",
              "spanId": "251f89cfa368db92",
              "parentSpanId": "0e1f3d821df03d59",
              "name": "ChatCompletion",
              "kind": 1,
              "startTimeUnixNano": "1791061358166907000",
              "endTimeUnixNano": "1791061361398541000",
              "attributes": [
                {
                  "key": "llm.system",
                  "value": {
                    "stringValue": "openai"
                  }
                },
                {
                  "key": "input.value",
                  "value": {
                    "stringValue": "{\"model\": \"openai/gpt-6-luna\", \"messages\": [{\"role\": \"user\", \"content\": \"List key facts about: What is an agent trace?\"}]}"
                  }
                },
                {
                  "key": "input.mime_type",
                  "value": {
                    "stringValue": "application/json"
                  }
                },
                {
                  "key": "output.value",
                  "value": {
                    "stringValue": "{\"id\":\"chatcmpl-EV1AMlFMAux4TPXGalT8n8WFpz9de\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"content\":\"- **An agent trace** is a record of an AI agent\u2019s execution as it works toward a task.\\n- It may include the agent\u2019s inputs and outputs, tool calls and results, handoffs to other agents, errors, timing, and other metadata.\\n- Traces often show events in order and may group them into nested steps or spans.\\n- They help developers debug behavior, measure performance, evaluate results, and audit tool use.\\n- A trace is **not necessarily a transcript of the agent\u2019s internal reasoning**; it records only what the system captures.\\n- Trace contents and formats vary by platform, and traces may contain sensitive information that needs protection.\",\"role\":\"assistant\",\"annotations\":[],\"provider_specific_fields\":{\"refusal\":null}},\"provider_specific_fields\":{}}],\"created\":1791061358,\"model\":\"openai/gpt-6-luna\",\"object\":\"chat.completion\",\"service_tier\":\"default\",\"usage\":{\"completion_tokens\":262,\"prompt_tokens\":17,\"total_tokens\":279,\"completion_tokens_details\":{\"accepted_prediction_tokens\":0,\"audio_tokens\":0,\"reasoning_tokens\":121,\"rejected_prediction_tokens\":0},\"prompt_tokens_details\":{\"audio_tokens\":0,\"cache_write_tokens\":0,\"cached_tokens\":0,\"cache_creation_tokens\":0}}}"
                  }
                },
                {
                  "key": "output.mime_type",
                  "value": {
                    "stringValue": "application/json"
                  }
                },
                {
                  "key": "llm.invocation_parameters",
                  "value": {
                    "stringValue": "{\"model\": \"openai/gpt-6-luna\"}"
                  }
                },
                {
                  "key": "llm.input_messages.0.message.role",
                  "value": {
                    "stringValue": "user"
                  }
                },
                {
                  "key": "llm.input_messages.0.message.content",
                  "value": {
                    "stringValue": "List key facts about: What is an agent trace?"
                  }
                },
                {
                  "key": "llm.model_name",
                  "value": {
                    "stringValue": "openai/gpt-6-luna"
                  }
                },
                {
                  "key": "llm.token_count.total",
                  "value": {
                    "intValue": "279"
                  }
                },
                {
                  "key": "llm.token_count.prompt",
                  "value": {
                    "intValue": "17"
                  }
                },
                {
                  "key": "llm.token_count.completion",
                  "value": {
                    "intValue": "262"
                  }
                },
                {
                  "key": "llm.token_count.prompt_details.cache_read",
                  "value": {
                    "intValue": "0"
                  }
                },
                {
                  "key": "llm.token_count.prompt_details.cache_write",
                  "value": {
                    "intValue": "0"
                  }
                },
                {
                  "key": "llm.token_count.prompt_details.audio",
                  "value": {
                    "intValue": "0"
                  }
                },
                {
                  "key": "llm.token_count.completion_details.reasoning",
                  "value": {
                    "intValue": "121"
                  }
                },
                {
                  "key": "llm.token_count.completion_details.audio",
                  "value": {
                    "intValue": "0"
                  }
                },
                {
                  "key": "llm.output_messages.0.message.role",
                  "value": {
                    "stringValue": "assistant"
                  }
                },
                {
                  "key": "llm.output_messages.0.message.content",
                  "value": {
                    "stringValue": "- **An agent trace** is a record of an AI agent\u2019s execution as it works toward a task.\n- It may include the agent\u2019s inputs and outputs, tool calls and results, handoffs to other agents, errors, timing, and other metadata.\n- Traces often show events in order and may group them into nested steps or spans.\n- They help developers debug behavior, measure performance, evaluate results, and audit tool use.\n- A trace is **not necessarily a transcript of the agent\u2019s internal reasoning**; it records only what the system captures.\n- Trace contents and formats vary by platform, and traces may contain sensitive information that needs protection."
                  }
                },
                {
                  "key": "llm.finish_reason",
                  "value": {
                    "stringValue": "stop"
                  }
                },
                {
                  "key": "openinference.span.kind",
                  "value": {
                    "stringValue": "LLM"
                  }
                }
              ],
              "status": {
                "code": 1
              },
              "flags": 256
            }
          ]
        },
        {
          "scope": {
            "name": "__main__"
          },
          "spans": [
            {
              "traceId": "233c54429123cf3eecb0c0cdd275daea",
              "spanId": "0e1f3d821df03d59",
              "parentSpanId": "fddaf2da465baf71",
              "name": "search_agent",
              "kind": 1,
              "startTimeUnixNano": "1791061358150691000",
              "endTimeUnixNano": "1791061361398579000",
              "attributes": [
                {
                  "key": "gen_ai.agent.name",
                  "value": {
                    "stringValue": "search_agent"
                  }
                },
                {
                  "key": "openinference.span.kind",
                  "value": {
                    "stringValue": "AGENT"
                  }
                },
                {
                  "key": "input.value",
                  "value": {
                    "stringValue": "List key facts about: What is an agent trace?"
                  }
                },
                {
                  "key": "output.value",
                  "value": {
                    "stringValue": "- **An agent trace** is a record of an AI agent\u2019s execution as it works toward a task.\n- It may include the agent\u2019s inputs and outputs, tool calls and results, handoffs to other agents, errors, timing, and other metadata.\n- Traces often show events in order and may group them into nested steps or spans.\n- They help developers debug behavior, measure performance, evaluate results, and audit tool use.\n- A trace is **not necessarily a transcript of the agent\u2019s internal reasoning**; it records only what the system captures.\n- Trace contents and formats vary by platform, and traces may contain sensitive information that needs protection."
                  }
                }
              ],
              "status": {},
              "flags": 256
            }
          ]
        }
      ]
    },
    {
      "resource": {
        "attributes": [
          {
            "key": "telemetry.sdk.language",
            "value": {
              "stringValue": "python"
            }
          },
          {
            "key": "telemetry.sdk.name",
            "value": {
              "stringValue": "opentelemetry"
            }
          },
          {
            "key": "telemetry.sdk.version",
            "value": {
              "stringValue": "1.45.0"
            }
          },
          {
            "key": "service.instance.id",
            "value": {
              "stringValue": "c949636c-f59d-48d0-8239-a92b83ddc0ff"
            }
          },
          {
            "key": "telemetry.auto.version",
            "value": {
              "stringValue": "0.66b0"
            }
          },
          {
            "key": "service.name",
            "value": {
              "stringValue": "unknown_service:python3"
            }
          }
        ]
      },
      "scopeSpans": [
        {
          "scope": {
            "name": "litellm.gateway.client"
          },
          "spans": [
            {
              "traceId": "233c54429123cf3eecb0c0cdd275daea",
              "spanId": "0ec1817127832b0c",
              "parentSpanId": "7ba1e22608c20ae9",
              "name": "gateway.request",
              "kind": 3,
              "startTimeUnixNano": "1791061361399259000",
              "endTimeUnixNano": "1791061363203340000",
              "attributes": [
                {
                  "key": "litellm.gateway.attempt",
                  "value": {
                    "boolValue": true
                  }
                },
                {
                  "key": "http.request.method",
                  "value": {
                    "stringValue": "POST"
                  }
                },
                {
                  "key": "url.full",
                  "value": {
                    "stringValue": "http://localhost:4002/v1/chat/completions"
                  }
                },
                {
                  "key": "server.address",
                  "value": {
                    "stringValue": "localhost"
                  }
                },
                {
                  "key": "http.response.status_code",
                  "value": {
                    "intValue": "200"
                  }
                },
                {
                  "key": "litellm.call_id",
                  "value": {
                    "stringValue": "e84366c5-5d88-4ec0-bc54-6b5000ae11d1"
                  }
                }
              ],
              "status": {},
              "flags": 256
            }
          ]
        },
        {
          "scope": {
            "name": "openinference.instrumentation.openai",
            "version": "0.1.63"
          },
          "spans": [
            {
              "traceId": "233c54429123cf3eecb0c0cdd275daea",
              "spanId": "7ba1e22608c20ae9",
              "parentSpanId": "7756eefae3c9e2e9",
              "name": "ChatCompletion",
              "kind": 1,
              "startTimeUnixNano": "1791061361398942000",
              "endTimeUnixNano": "1791061363203834000",
              "attributes": [
                {
                  "key": "llm.system",
                  "value": {
                    "stringValue": "openai"
                  }
                },
                {
                  "key": "input.value",
                  "value": {
                    "stringValue": "{\"model\": \"openai/gpt-6-luna\", \"messages\": [{\"role\": \"user\", \"content\": \"Using these notes, answer 'What is an agent trace?':\\n- **An agent trace** is a record of an AI agent\u2019s execution as it works toward a task.\\n- It may include the agent\u2019s inputs and outputs, tool calls and results, handoffs to other agents, errors, timing, and other metadata.\\n- Traces often show events in order and may group them into nested steps or spans.\\n- They help developers debug behavior, measure performance, evaluate results, and audit tool use.\\n- A trace is **not necessarily a transcript of the agent\u2019s internal reasoning**; it records only what the system captures.\\n- Trace contents and formats vary by platform, and traces may contain sensitive information that needs protection.\"}]}"
                  }
                },
                {
                  "key": "input.mime_type",
                  "value": {
                    "stringValue": "application/json"
                  }
                },
                {
                  "key": "output.value",
                  "value": {
                    "stringValue": "{\"id\":\"chatcmpl-EV1APW9BhnXpYoujMXnLb4ElRb9gM\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"content\":\"An **agent trace** is a record of an AI agent\u2019s execution as it works toward a task. It can include inputs and outputs, tool calls and results, handoffs, errors, timing, and other metadata, often organized as ordered or nested steps.\\n\\nTraces help developers debug behavior, measure performance, evaluate results, and audit tool use. They capture only what the system records\u2014not necessarily the agent\u2019s internal reasoning. Their contents and formats vary by platform, and they may contain sensitive information that should be protected.\",\"role\":\"assistant\",\"annotations\":[],\"provider_specific_fields\":{\"refusal\":null}},\"provider_specific_fields\":{}}],\"created\":1791061361,\"model\":\"openai/gpt-6-luna\",\"object\":\"chat.completion\",\"service_tier\":\"default\",\"usage\":{\"completion_tokens\":107,\"prompt_tokens\":151,\"total_tokens\":258,\"completion_tokens_details\":{\"accepted_prediction_tokens\":0,\"audio_tokens\":0,\"reasoning_tokens\":0,\"rejected_prediction_tokens\":0},\"prompt_tokens_details\":{\"audio_tokens\":0,\"cache_write_tokens\":0,\"cached_tokens\":0,\"cache_creation_tokens\":0}}}"
                  }
                },
                {
                  "key": "output.mime_type",
                  "value": {
                    "stringValue": "application/json"
                  }
                },
                {
                  "key": "llm.invocation_parameters",
                  "value": {
                    "stringValue": "{\"model\": \"openai/gpt-6-luna\"}"
                  }
                },
                {
                  "key": "llm.input_messages.0.message.role",
                  "value": {
                    "stringValue": "user"
                  }
                },
                {
                  "key": "llm.input_messages.0.message.content",
                  "value": {
                    "stringValue": "Using these notes, answer 'What is an agent trace?':\n- **An agent trace** is a record of an AI agent\u2019s execution as it works toward a task.\n- It may include the agent\u2019s inputs and outputs, tool calls and results, handoffs to other agents, errors, timing, and other metadata.\n- Traces often show events in order and may group them into nested steps or spans.\n- They help developers debug behavior, measure performance, evaluate results, and audit tool use.\n- A trace is **not necessarily a transcript of the agent\u2019s internal reasoning**; it records only what the system captures.\n- Trace contents and formats vary by platform, and traces may contain sensitive information that needs protection."
                  }
                },
                {
                  "key": "llm.model_name",
                  "value": {
                    "stringValue": "openai/gpt-6-luna"
                  }
                },
                {
                  "key": "llm.token_count.total",
                  "value": {
                    "intValue": "258"
                  }
                },
                {
                  "key": "llm.token_count.prompt",
                  "value": {
                    "intValue": "151"
                  }
                },
                {
                  "key": "llm.token_count.completion",
                  "value": {
                    "intValue": "107"
                  }
                },
                {
                  "key": "llm.token_count.prompt_details.cache_read",
                  "value": {
                    "intValue": "0"
                  }
                },
                {
                  "key": "llm.token_count.prompt_details.cache_write",
                  "value": {
                    "intValue": "0"
                  }
                },
                {
                  "key": "llm.token_count.prompt_details.audio",
                  "value": {
                    "intValue": "0"
                  }
                },
                {
                  "key": "llm.token_count.completion_details.reasoning",
                  "value": {
                    "intValue": "0"
                  }
                },
                {
                  "key": "llm.token_count.completion_details.audio",
                  "value": {
                    "intValue": "0"
                  }
                },
                {
                  "key": "llm.output_messages.0.message.role",
                  "value": {
                    "stringValue": "assistant"
                  }
                },
                {
                  "key": "llm.output_messages.0.message.content",
                  "value": {
                    "stringValue": "An **agent trace** is a record of an AI agent\u2019s execution as it works toward a task. It can include inputs and outputs, tool calls and results, handoffs, errors, timing, and other metadata, often organized as ordered or nested steps.\n\nTraces help developers debug behavior, measure performance, evaluate results, and audit tool use. They capture only what the system records\u2014not necessarily the agent\u2019s internal reasoning. Their contents and formats vary by platform, and they may contain sensitive information that should be protected."
                  }
                },
                {
                  "key": "llm.finish_reason",
                  "value": {
                    "stringValue": "stop"
                  }
                },
                {
                  "key": "openinference.span.kind",
                  "value": {
                    "stringValue": "LLM"
                  }
                }
              ],
              "status": {
                "code": 1
              },
              "flags": 256
            }
          ]
        },
        {
          "scope": {
            "name": "__main__"
          },
          "spans": [
            {
              "traceId": "233c54429123cf3eecb0c0cdd275daea",
              "spanId": "7756eefae3c9e2e9",
              "parentSpanId": "fddaf2da465baf71",
              "name": "writer_agent",
              "kind": 1,
              "startTimeUnixNano": "1791061361398626000",
              "endTimeUnixNano": "1791061363203851000",
              "attributes": [
                {
                  "key": "gen_ai.agent.name",
                  "value": {
                    "stringValue": "writer_agent"
                  }
                },
                {
                  "key": "openinference.span.kind",
                  "value": {
                    "stringValue": "AGENT"
                  }
                },
                {
                  "key": "input.value",
                  "value": {
                    "stringValue": "Using these notes, answer 'What is an agent trace?':\n- **An agent trace** is a record of an AI agent\u2019s execution as it works toward a task.\n- It may include the agent\u2019s inputs and outputs, tool calls and results, handoffs to other agents, errors, timing, and other metadata.\n- Traces often show events in order and may group them into nested steps or spans.\n- They help developers debug behavior, measure performance, evaluate results, and audit tool use.\n- A trace is **not necessarily a transcript of the agent\u2019s internal reasoning**; it records only what the system captures.\n- Trace contents and formats vary by platform, and traces may contain sensitive information that needs protection."
                  }
                },
                {
                  "key": "output.value",
                  "value": {
                    "stringValue": "An **agent trace** is a record of an AI agent\u2019s execution as it works toward a task. It can include inputs and outputs, tool calls and results, handoffs, errors, timing, and other metadata, often organized as ordered or nested steps.\n\nTraces help developers debug behavior, measure performance, evaluate results, and audit tool use. They capture only what the system records\u2014not necessarily the agent\u2019s internal reasoning. Their contents and formats vary by platform, and they may contain sensitive information that should be protected."
                  }
                }
              ],
              "status": {},
              "flags": 256
            },
            {
              "traceId": "233c54429123cf3eecb0c0cdd275daea",
              "spanId": "fddaf2da465baf71",
              "name": "research_agent",
              "kind": 1,
              "startTimeUnixNano": "1791061358150661000",
              "endTimeUnixNano": "1791061363203862000",
              "attributes": [
                {
                  "key": "gen_ai.agent.name",
                  "value": {
                    "stringValue": "research_agent"
                  }
                },
                {
                  "key": "openinference.span.kind",
                  "value": {
                    "stringValue": "AGENT"
                  }
                },
                {
                  "key": "input.value",
                  "value": {
                    "stringValue": "What is an agent trace?"
                  }
                },
                {
                  "key": "output.value",
                  "value": {
                    "stringValue": "An **agent trace** is a record of an AI agent\u2019s execution as it works toward a task. It can include inputs and outputs, tool calls and results, handoffs, errors, timing, and other metadata, often organized as ordered or nested steps.\n\nTraces help developers debug behavior, measure performance, evaluate results, and audit tool use. They capture only what the system records\u2014not necessarily the agent\u2019s internal reasoning. Their contents and formats vary by platform, and they may contain sensitive information that should be protected."
                  }
                }
              ],
              "status": {},
              "flags": 256
            }
          ]
        }
      ]
    }
  ]
}