LDP Protocol — Python SDK
Identity-aware communication protocol for multi-agent LLM systems.
pip install ldp-protocol
Quick Start
Create a delegate
from ldp_protocol import LdpDelegate, LdpCapability, QualityMetrics
class MyDelegate(LdpDelegate):
async def handle_task(self, skill, input_data, task_id):
return {"answer": "42"}, 0.95
delegate = MyDelegate(
delegate_id="ldp:delegate:my-agent",
name="My Agent",
model_family="claude",
model_version="claude-sonnet-4-6",
capabilities=[
LdpCapability(
name="reasoning",
quality=QualityMetrics(quality_score=0.85, cost_per_call_usd=0.01),
),
],
)
delegate.run(port=8090) # requires: pip install ldp-protocol[server]
Discover and invoke
from ldp_protocol import LdpClient
async with LdpClient() as client:
identity = await client.discover("http://localhost:8090")
print(f"Found: {identity.name} ({identity.model_family})")
result = await client.submit_task(
"http://localhost:8090",
skill="reasoning",
input_data={"prompt": "Analyze the tradeoffs..."},
)
print(f"Output: {result['output']}")
print(f"Provenance: {result['provenance']}")
Multi-delegate routing
from ldp_protocol import LdpRouter, RoutingStrategy
async with LdpRouter() as router:
await router.discover_delegates([
"http://fast-model:8091",
"http://deep-model:8092",
])
# Route by quality, cost, latency, or balanced score
result = await router.route_and_submit(
skill="reasoning",
input_data={"prompt": "Complex analysis..."},
strategy=RoutingStrategy.QUALITY,
)
print(f"Routed to: {result['routed_to']['name']}")
Links
Metadata
Release files for ldp-protocol 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ldp_protocol-0.2.0.tar.gz | 16.9 kB | Without provenance | Details for ldp_protocol-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ldp_protocol-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for ldp_protocol-0.2.0-py3-none-any.whl |
Total release size: 35.5 kB
Release files / ldp_protocol-0.2.0.tar.gz
| Download URL | ldp_protocol-0.2.0.tar.gz |
|---|---|
| Size | 16.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
76e53f9d0699ca7e77079236aebfe54cffcc3a22b33fdaf589a7550f5db8496c
|
|
BLAKE2b-256 checksum How to use checksums |
3e0fef232f6a1b330bf296f848abbf8c6c9346ecc4726eb51804995a4a269dd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.7
|
Release files / ldp_protocol-0.2.0-py3-none-any.whl
| Download URL | ldp_protocol-0.2.0-py3-none-any.whl |
|---|---|
| Size | 18.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df01af92bf3e635385bd269f4cc140e67aef924612b32f7a96b432d98968bc74
|
|
BLAKE2b-256 checksum How to use checksums |
e3a96a5eadaf6a30fd0d40838a751a9903a480457f64db5db7fbba3b39e4742a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.7
|
Security for ldp-protocol 0.2.0
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.