Skip to main content

Pydantic data models and adapters for the LLM Protocol Suite.

Project description

LLM Protocol Suite

LLM Protocol Suite solves the data-definition drift that appears when different agent projects each invent their own message, tool-call, runtime, usage, and provider-response shapes.

It provides a small, explicit protocol layer for agent systems: Pydantic v2 models for model messages, multimodal content parts, tool calls, runtime envelopes, tool execution policy, usage, errors, and provider adapters. The goal is to let internal agent projects exchange structured LLM data without depending directly on any one provider SDK or framework's private format.

This package is not an agent framework. It does not call model APIs, execute tools, manage retries, request approvals, or orchestrate workflows. It defines and validates the shared data language those systems can build on.

Install

pip install -e ".[dev]"

Example

from llm_protocol_suite import ModelMessage, ModelRequest, TextPart

request = ModelRequest(
    model="deepseek-chat",
    messages=[
        ModelMessage(role="user", content=[TextPart(text="Hello")]),
    ],
)

print(request.model_dump())

OpenAI Mapping

from llm_protocol_suite import ModelMessage, ModelRequest, TextPart
from llm_protocol_suite.adapters.openai import to_openai_chat_request

request = ModelRequest(
    model="gpt-4.1-mini",
    messages=[ModelMessage(role="user", content=[TextPart(text="Hello")])],
)

payload = to_openai_chat_request(request)

Non-goals

v0.1 does not call provider APIs, execute tools, run retries, manage approvals, or orchestrate agents.

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

llm_protocol_suite-0.1.0.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

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

llm_protocol_suite-0.1.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm_protocol_suite-0.1.0.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for llm_protocol_suite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d19efc22ccdfac0b2f32bc22b897b9d51157ca5ff649a32cff46761d68ded432
MD5 3bc767f0a7ac67082877dfdfc12808b2
BLAKE2b-256 bd8e0e4584d27be56e2c6343d5dcde0173507f1598b1852fff2c43a169857bd2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llm_protocol_suite-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61666dd58385d338a0c96aeb03eca2d563f9060d6dfbfde9add21e11ac2f8737
MD5 542dcebbe1314ce3c775ba0af78cac6e
BLAKE2b-256 86a8a0a30d3eb55834d68088b615393747aaaacece2f7cdf5fec44016ce442e0

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