Skip to main content

Use AIMarket capabilities as native tools in LangChain/LangGraph, CrewAI and AutoGen

Project description

aimarket-bridges

Give your LangGraph, CrewAI or AutoGen agent 47 more tools in two lines.

from aimarket_bridges.langchain import aimarket_tools

tools = aimarket_tools("https://modelmarket.dev", intent="verifiable randomness")

Every tool is a real capability on the AIMarket network — a verifiable random draw, a Byzantine-resistant consensus number, a proof of elapsed sequential work, an optimal-transport plan — each returning a signed receipt your agent can verify without trusting the marketplace.

Install

pip install "aimarket-bridges[langgraph]"
pip install "aimarket-bridges[crewai]"
pip install "aimarket-bridges[autogen]"

The core has no framework dependency. Install only the one you use — CrewAI and AutoGen do not agree on a pydantic version and cannot share an environment.

The three adapters

Framework Import Returns
LangChain / LangGraph aimarket_bridges.langchain list[StructuredTool]
CrewAI aimarket_bridges.crewai list[crewai.tools.BaseTool]
AutoGen aimarket_bridges.autogen list[autogen_core.tools.BaseTool]

Same signature everywhere:

aimarket_tools(
    base_url,               # the hub, e.g. "https://modelmarket.dev"
    intent="",              # rank by relevance instead of taking the whole catalogue
    limit=0,                # cap how many tools the agent sees
    max_price_usd=None,     # never hand over a tool you cannot afford
    free_only=False,
    budget_usd=1.0,         # hard ceiling across every call these tools make
)

What it costs

Capabilities are priced per call, from $0.001. The budget_usd ceiling is enforced before each call and is safe across threads, so an agent that loops cannot outspend it. max_price_usd filters at build time — the honest place for a limit, because once a tool is in the agent's registry the agent decides when to call it.

There is a free trial tier: an agent with no wallet can try capabilities before any payment is set up.

Receipts actually verify

Every call returns a signed 7-field receipt. It is kept out of the tool's text result — it would cost the model context for a blob it never reads — and is available through the framework's own metadata channel and through HubClient.last_receipt.

Verification uses the key of the capability's origin, not the hub's. This matters: 42 of the 47 live capabilities are federated, so their receipts are signed by the provider, not by the broker that routed the call. Checking against the hub's key reports invalid-signature on perfectly valid receipts for 89% of the catalogue.

Refusals are results, not crashes

When a capability rejects its input, your agent gets a sentence it can act on:

sortes.draw@v1 refused this input: 'num_bytes' must be an integer, got str

and it corrects the argument on the next turn. Nothing raises, so one bad argument does not abort the surrounding graph or crew. Transport and configuration failures do raise — those the model cannot fix, and swallowing them yields an agent that reports success having called nothing.

Without a framework

The core is usable on its own if you are wiring something with no adapter yet:

from aimarket_bridges import fetch_catalog, HubClient

capabilities = fetch_catalog("https://modelmarket.dev", intent="consensus")
with HubClient("https://modelmarket.dev", budget_usd=0.50) as hub:
    result = hub.invoke(capabilities[0], {"values": [1.0, 2.0, 3.0, 100.0]})
    print(result.output, result.receipt_verified)

fetch_catalog raises when the hub is unreachable rather than returning an empty list. An agent that starts up believing it has no capabilities is a much worse failure than one that refuses to start.

Notes on the frameworks

Written against langchain-core 1.5.2, langgraph 1.2.10, crewai 1.15.8, autogen-core 0.7.5, each verified by introspection rather than from documentation. They disagree about how a tool declares its arguments, which is most of what this package absorbs:

  • langchain-core accepts a raw JSON Schema dict, so a capability's schema passes straight through.
  • crewai requires a pydantic model and reads .model_fields off it.
  • autogen derives schemas from Python type annotations, so a runtime-shaped capability needs an explicit args model.

The oneOf in kantor.transport@v1 (a point is an array of numbers or a number) and in fermat.route@v1 (an edge is an array or an object) becomes a proper union in all three.

Apache-2.0.

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

aimarket_bridges-0.1.0.tar.gz (204.3 kB view details)

Uploaded Source

Built Distribution

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

aimarket_bridges-0.1.0-py3-none-any.whl (62.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aimarket_bridges-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2c37712a056872e54c3aedfff67cc49b0a3583f7de68a9f12cb7505b95a3aa0c
MD5 791f6c8b58dc8b56576a922605886926
BLAKE2b-256 3e85071870ad954ddaa593cd8d83a60cabf66976795bd6cc2f2463d215d2f91e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aimarket_bridges-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a1f93878b50c7cc29a98890a854689808571e191185025f5b68d6512331d9d00
MD5 51fb5a1fd3f3911f33593d84d72c3cc5
BLAKE2b-256 df625978f40ad49854a6635a54f05bd41c7250b188c8c7814bb3ca7bfdc34025

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