Skip to main content

Observability SDK for AI agents — traces, costs, and alerts in 3 lines of code.

Project description

Vantra Python SDK

Observability for AI agents — traces, costs, and alerts in 3 lines of code.

Install

pip install vantra

Quickstart

import vantra

vantra.init(
    api_key="van_live_...",
    project="my-agent"
)

@vantra.trace
def run_agent(message: str):
    # your existing code — completely untouched
    return agent.run(message)

Every call to run_agent appears as a trace in your Vantra dashboard with timing, token usage, cost, and status.

Nested spans

@vantra.trace
def run_agent(message: str):
    with vantra.span("search", kind="tool") as span:
        results = search(message)
        span.set_output({"results": results})

    with vantra.span("generate", kind="llm"):
        return llm.chat(message, context=results)

Auto-patching

Vantra automatically captures OpenAI and Anthropic calls after init() — no extra code needed.

import vantra
import openai

vantra.init(api_key="van_live_...", project="my-agent")
client = openai.OpenAI()

@vantra.trace
def ask(question: str) -> str:
    # This call is captured automatically
    response = client.chat.completions.create(
        model="gpt-4o",
        messages=[{"role": "user", "content": question}]
    )
    return response.choices[0].message.content

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vantra-0.1.2.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vantra-0.1.2-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file vantra-0.1.2.tar.gz.

File metadata

  • Download URL: vantra-0.1.2.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for vantra-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3cbb1e6d7a0d3d8e822d6f21cb3a63bf1ef3a637ea5535ed132934c5f7858694
MD5 83089457c8e4b78174bc1331e38e9a87
BLAKE2b-256 5f43be37c8a0f5f71b180dc870d2af6ddb44172b8d1149ca65d5c327fa2009d5

See more details on using hashes here.

File details

Details for the file vantra-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: vantra-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for vantra-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a208724dc72ddbc532f8715515261207baddff32f1c9fa158c56654c035042c9
MD5 6166a0937514ccba9cf51dda02b3fc3d
BLAKE2b-256 c93813dcf10598a8538da25d7b8eb22a3c659de01158bffed2575de691c4cb7a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page