LDP — LLM Delegate Protocol: identity-aware communication for multi-agent LLM systems
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ldp_protocol-0.2.0.tar.gz
(16.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ldp_protocol-0.2.0.tar.gz.
File metadata
- Download URL: ldp_protocol-0.2.0.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76e53f9d0699ca7e77079236aebfe54cffcc3a22b33fdaf589a7550f5db8496c
|
|
| MD5 |
b6aaf52282642dcb915fad025fb43ed8
|
|
| BLAKE2b-256 |
3e0fef232f6a1b330bf296f848abbf8c6c9346ecc4726eb51804995a4a269dd7
|
File details
Details for the file ldp_protocol-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ldp_protocol-0.2.0-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df01af92bf3e635385bd269f4cc140e67aef924612b32f7a96b432d98968bc74
|
|
| MD5 |
0f8a16c2eb49fc16bda588b084a3230d
|
|
| BLAKE2b-256 |
e3a96a5eadaf6a30fd0d40838a751a9903a480457f64db5db7fbba3b39e4742a
|