Skip to main content

majordomo-frameworks

Framework adapters for routing LLM requests through Majordomo Gateway with centralized logging and cost tracking.

Installation

# Core package (no framework dependencies)
pip install majordomo-frameworks

# With Agno support
pip install majordomo-frameworks[agno]

# With Pydantic AI support
pip install majordomo-frameworks[pydantic-ai]

Quick Start

Shared utilities (zero dependencies)

from majordomo_frameworks import build_headers, check_environment, Provider

# Check required env vars are set
missing = check_environment("openai")

# Build gateway headers
headers = build_headers(feature="my-feature", step="inference", user_id="alice")

Agno

from majordomo_frameworks.agno import create_model

model = create_model("openai", feature="support-agent", user_id="alice")

Pydantic AI

from majordomo_frameworks.pydantic_ai import create_model, build_extra_headers
from pydantic_ai.settings import AnthropicModelSettings

# Create model routed through the gateway
model = create_model("anthropic")

# Build headers for model settings
headers = build_extra_headers(feature="research-agent", step="synthesis")

# Use with Pydantic AI model settings
settings = AnthropicModelSettings(
    extra_headers=headers,
    # ... other settings like anthropic_thinking, etc.
)

Supported Providers

Provider Agno Pydantic AI
OpenAI OpenAIChat OpenAIModel
Anthropic OpenAILike AnthropicModel
Gemini OpenAILike OpenAIModel

Environment Variables

Variable Required Description
MAJORDOMO_GATEWAY_URL No Gateway URL (default: http://localhost:7680)
MAJORDOMO_API_KEY Yes Your Majordomo API key
OPENAI_API_KEY Per provider OpenAI API key
ANTHROPIC_API_KEY Per provider Anthropic API key
GEMINI_API_KEY Per provider Gemini API key

Documentation

  • Pydantic AI Guide - Complete guide with migration instructions, advanced usage, and examples

Examples

License

MIT

Metadata

Release files for majordomo-frameworks 0.2.0

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

Source distribution (sdist)

Source distribution for majordomo-frameworks 0.2.0
File Size Uploaded
majordomo_frameworks-0.2.0.tar.gz 343.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for majordomo-frameworks 0.2.0
File Interpreter ABI Platform
majordomo_frameworks-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 351.5 kB

Release files / majordomo_frameworks-0.2.0.tar.gz

Download URL majordomo_frameworks-0.2.0.tar.gz
Size 343.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fb1b2f3442529deeab0afa85849277101df4eb1d3f44d99b6b5dce2a86b7f1b1
BLAKE2b-256 checksum
How to use checksums
655c95ce96f755414304083bbd117fbc039268e9575e18484555e80882499736
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / majordomo_frameworks-0.2.0-py3-none-any.whl

Download URL majordomo_frameworks-0.2.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aed7baba1d50ede7c6f7ac95f1e6d4b804a0ecb06033a309e4dab6022b0a4e21
BLAKE2b-256 checksum
How to use checksums
42c746fa11e821c4483cc4afce4c0f4366c1f9475691c2bd5c364ea2dcc97951
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

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