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.1.tar.gz (10.7 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.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vantra-0.1.1.tar.gz
  • Upload date:
  • Size: 10.7 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.1.tar.gz
Algorithm Hash digest
SHA256 2a749b1b7a885999579cc4abb7b38751c9ca8ac16b77fc2bf919d2bc326f582c
MD5 a811da07c8beb965b58e3c06e9c95c0d
BLAKE2b-256 e34193a41dcdba70d5d9c89930118720f43098371d9c1cfacf3583905ca88389

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vantra-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c7c798cddab2b8614e5bbdbe6452e1a06341c47bf5d48e4bfeabf40441b44f79
MD5 932021f4330bc4b19a9298735f82c6a8
BLAKE2b-256 c786ee82ed32df4dd053b3d0fc080499a069fe85e58bc7afe8ec6924d3f3988a

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