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.0.tar.gz (5.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.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vantra-0.1.0.tar.gz
  • Upload date:
  • Size: 5.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.0.tar.gz
Algorithm Hash digest
SHA256 37ef4969ad27b1f8e07ff4379e4089512e5a46453d8e186f7953bf0aa20b7c66
MD5 9e6aea49d7071e41b1a3bf003bd7d573
BLAKE2b-256 5086a3afc46bbf28ad619a8ea6c71680fe10080da7cb661dd242546ebe6b79c0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vantra-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f722e1ed4e23f63806095a46e7c58608b36dcfc0125713019b3edd3dbbf574ba
MD5 0f4f45de2a7ac328662ab66a240ec4ae
BLAKE2b-256 83a31b4aaa5023a34e6fb845e851dd589dbf3fae98b5bb6fd5e500fc83a96ac3

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