Skip to main content

Vantage

Vantage Logo

A lightweight, protocol-first Python library for building AI agents.

CI PyPI version Python Version License: MIT Code Style: Ruff

Vantage is a modular Python library for building AI agents. It follows SOLID principles and defines every component — LLMs, tools, and memory — as an abstract interface, making each one independently replaceable without changing agent logic.

Features

  • Simple YAML configuration: Define agents, models, and tools in a flat, human-readable YAML file. No boilerplate.
  • Swappable components: Implement LLMBase, ToolBase, or MemoryBase to replace any layer transparently.
  • Multi-agent flows: Route requests between specialised agents with HandoverTool.
  • Sync and async: Full async support with token streaming alongside the synchronous API.
  • Execution tracing: Export a PNG diagram of every step in an agent's execution via save_trace_png.
  • Structured output: Request JSON-schema-validated responses with a one-line field shorthand.

Installation

pip install vantage-agents

Quick Start

Python API

from vantage.core import Agent
from vantage.llms import OpenAIModel
from vantage.memory import LocalMemory
from vantage.tools import Calculator

agent = Agent(
    llm=OpenAIModel(model="gpt-4o-mini"),
    tools=[Calculator()],
    memory=LocalMemory(),
    system_prompt="You are a math assistant.",
)

response = agent.run("What is (12 + 8) / 5?")
print(response.content)

YAML configuration

Define agents in a YAML file — the model key sets both the provider and the model in one line:

agents:
  calc_bot:
    model: groq/llama-3.3-70b-versatile
    system_prompt: "You are a math assistant. Use the calculator tool for arithmetic."
    tools: [calculator]
    response_schema:
      result: number
      explanation: string
from vantage import run_yaml_agent
from vantage.tools import Calculator

resp = run_yaml_agent("agents.yaml", "calc_bot", "What is 15 * 12?", tools=[Calculator()])
print(resp.content)

response_schema accepts a flat {field: type} shorthand that is automatically expanded to a full JSON Schema. Supported types: string, number, integer, boolean, array, object.

Async and streaming

import asyncio
from vantage.core import AsyncAgent
from vantage.llms import AsyncOpenAIModel

agent = AsyncAgent(
    llm=AsyncOpenAIModel(model="gpt-4o-mini"),
    system_prompt="You are helpful.",
)

async def main() -> None:
    async for token in agent.stream("Explain gradient descent briefly."):
        print(token, end="", flush=True)

asyncio.run(main())

Architecture

graph TD
    A[Agent / AsyncAgent] --> B[LLMBase]
    A --> C[MemoryBase]
    A --> D[ToolBase]
    B --> B1[OpenAIModel / AsyncOpenAIModel]
    B --> B2[GroqModel / AsyncGroqModel]
    C --> C1[LocalMemory]
    D --> D1[Calculator]
    D --> D2[HandoverTool]
    D --> D3[Custom Tools]

Every arrow in the diagram is an interface boundary — swap any node without touching the others.

Extending Vantage

Custom tool

from vantage.core import ToolBase

class WeatherTool(ToolBase):
    @property
    def name(self) -> str:
        return "get_weather"

    @property
    def description(self) -> str:
        return "Return the current weather for a city."

    def input_schema(self):
        return {
            "type": "object",
            "properties": {"city": {"type": "string"}},
            "required": ["city"],
            "additionalProperties": False,
        }

    def execute(self, **kwargs) -> str:
        city = kwargs["city"]
        return f"Sunny, 22 C in {city}"   # replace with a real API call

Custom LLM backend

from vantage.core import LLMBase
from vantage.core.models import Message, Role

class MyLLM(LLMBase):
    def generate(self, messages, tools, response_schema=None) -> Message:
        # call your backend here
        return Message(role=Role.ASSISTANT, content="...")

Multi-agent flows

from vantage import run_yaml_agent, Calculator
from vantage.core.handovers import HandoverTool

tools = [
    Calculator(),
    HandoverTool("math_expert", "Transfer to the math expert."),
    HandoverTool("word_expert", "Transfer to the word expert."),
]

resp = run_yaml_agent("agents.yaml", "gatekeeper", "What is 6 * 7?", tools=tools)
print(resp.content)

Execution tracing

Every AgentResponse carries a trace list. Render it as a PNG:

from vantage import save_trace_png

save_trace_png(resp.trace, "trace.png")

The diagram shows every step — user input, LLM reasoning, tool calls, tool results, and the final answer — with the actual content of each step.

Running the examples

git clone https://github.com/saqlain2204/vantage.git
cd vantage
pip install -e ".[dev]"
cp .env.example .env          # add your API keys

python -m examples.calculator_agent.run
python -m examples.custom_tool_agent.run
python -m examples.multi_agent_flow.run

Contributing

Contributions are welcome. See CONTRIBUTING.md for the development setup, coding conventions, and how to submit a pull request.

Changelog

See CHANGELOG.md for the version history.

License

Vantage is released under the MIT License.

Metadata

Release files for vantage-agents 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vantage-agents 0.1.1
File Size Uploaded Provenance Actions
vantage_agents-0.1.1.tar.gz 372.4 kB Without provenance Details for vantage_agents-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vantage-agents 0.1.1
File Interpreter ABI Platform Actions
vantage_agents-0.1.1-py3-none-any.whl Python 3 none any Details for vantage_agents-0.1.1-py3-none-any.whl

Total release size: 400.6 kB

Release files / vantage_agents-0.1.1.tar.gz

Download URL vantage_agents-0.1.1.tar.gz
Size 372.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fa5d2ebd52a885463de2e2480660b8b7bd9bbe78d851e789899487921ca600e1
BLAKE2b-256 checksum
How to use checksums
f54f951d22ec8f1a562d1d9db02da5f4ef1bf54284ecac5e435ebbcf7e83d047
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / vantage_agents-0.1.1-py3-none-any.whl

Download URL vantage_agents-0.1.1-py3-none-any.whl
Size 28.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23dfc2341c7d6e142ca8fbfef308691bad8c530c9ad061c09f2f6bd394a7c390
BLAKE2b-256 checksum
How to use checksums
f18f5b7926968a1d5e2619d6515e7e37c918c5e308de691a5b53cd9ecc040efb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Security for vantage-agents 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page