{"id":50308723,"url":"https://github.com/roble3/iicp-client-python","last_synced_at":"2026-05-28T19:00:33.556Z","repository":{"id":360648329,"uuid":"1239912525","full_name":"RobLe3/iicp-client-python","owner":"RobLe3","description":"Python client SDK for IICP — route tasks across an AI agent mesh by intent","archived":false,"fork":false,"pushed_at":"2026-05-27T09:08:39.000Z","size":148,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-27T10:21:04.025Z","etag":null,"topics":["ai-agents","asyncio","iicp","llm","protocol","python","sdk"],"latest_commit_sha":null,"homepage":"https://iicp.network","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RobLe3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-15T15:14:59.000Z","updated_at":"2026-05-27T09:07:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/RobLe3/iicp-client-python","commit_stats":null,"previous_names":["roble3/iicp-client-python"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/RobLe3/iicp-client-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLe3%2Fiicp-client-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLe3%2Fiicp-client-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLe3%2Fiicp-client-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLe3%2Fiicp-client-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobLe3","download_url":"https://codeload.github.com/RobLe3/iicp-client-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLe3%2Fiicp-client-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33622070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","asyncio","iicp","llm","protocol","python","sdk"],"created_at":"2026-05-28T19:00:21.121Z","updated_at":"2026-05-28T19:00:33.521Z","avatar_url":"https://github.com/RobLe3.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iicp-client · Python SDK\n\n[![CI](https://github.com/RobLe3/iicp-client-python/actions/workflows/ci.yml/badge.svg)](https://github.com/RobLe3/iicp-client-python/actions/workflows/ci.yml)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)\n[![Protocol](https://img.shields.io/badge/IICP-v1.5-indigo.svg)](https://iicp.network/spec)\n[![PyPI](https://img.shields.io/badge/PyPI-iicp--client-blue?logo=pypi\u0026logoColor=white)](https://pypi.org/project/iicp-client/)\n\nOfficial Python client library for the [IICP protocol](https://iicp.network) — route AI agent tasks by intent across a self-organising mesh of provider nodes. No central broker. No hardcoded endpoints.\n\n```\nurn:iicp:intent:llm:chat:v1  →  discover  →  select  →  submit\n```\n\n---\n\n## Install\n\n```bash\npip install iicp-client\n```\n\nRequires **Python ≥ 3.11** and [`httpx`](https://www.python-httpx.org/).\n\n---\n\n## Quickstart\n\n```python\nimport asyncio\nfrom iicp_client import IicpClient, ChatMessage\n\nasync def main():\n    client = IicpClient()\n\n    # chat_async discovers, selects best node, and submits in one call\n    response = await client.chat_async(\n        messages=[ChatMessage(role=\"user\", content=\"Hello from IICP!\")],\n    )\n    print(response.choices[0].message.content)\n\nasyncio.run(main())\n```\n\nSynchronous wrapper for scripts and notebooks:\n\n```python\nfrom iicp_client import IicpClient, ChatMessage\n\nclient   = IicpClient()\nresponse = client.chat([ChatMessage(role=\"user\", content=\"Hello from IICP!\")])\nprint(response.choices[0].message.content)\n```\n\n---\n\n## Configuration\n\n```python\nfrom iicp_client import ClientConfig\n\nconfig = ClientConfig(\n    directory_url = \"https://iicp.network\",  # IICP directory\n    timeout_ms    = 30_000,                  # max 120 000 (SDK-04)\n    region        = \"eu-central\",            # prefer nodes in region\n)\n```\n\n| Field | Default | Description |\n|-------|---------|-------------|\n| `directory_url` | `\"https://iicp.network\"` | IICP directory endpoint |\n| `timeout_ms` | `30000` | Request timeout — max 120 000 ms |\n| `region` | `None` | Preferred node region |\n| `max_retries` | `3` | Retry count for transient errors |\n\n---\n\n## Discover options\n\n```python\nfrom iicp_client import DiscoverOptions\n\nnode_list = await client.discover_async(\n    \"urn:iicp:intent:llm:chat:v1\",\n    DiscoverOptions(\n        region         = \"eu-central\",\n        model          = \"phi3:mini\",\n        min_reputation = 0.7,\n        limit          = 5,\n    )\n)\nnodes = node_list.nodes  # list of Node objects\n```\n\n---\n\n## Error handling\n\n```python\nfrom iicp_client import IicpClient, IicpError, ChatMessage\n\nclient = IicpClient()\ntry:\n    response = client.chat([ChatMessage(role=\"user\", content=\"hi\")])\nexcept IicpError as e:\n    print(f\"[{e.code}] {e.message}  (HTTP {e.http_status})\")\n```\n\nError codes match the [IICP error reference](https://iicp.network/docs/error-reference) — e.g. `task_timeout`, `capacity_exceeded`, `no_nodes_available`.\n\n---\n\n## SDK conformance\n\n| Rule | Description | Status |\n|------|-------------|--------|\n| SDK-01 | discover → select → submit pipeline with node retry | ✓ |\n| SDK-02 | `task_id` auto-generated (UUID v4) | ✓ |\n| SDK-03 | Intent URN pattern validation | ✓ |\n| SDK-04 | `timeout_ms` capped at 120 000 ms | ✓ |\n| SDK-05 | Retry on 429 / 503 with exponential back-off | ✓ |\n| SDK-06 | W3C `traceparent` propagation | ✓ |\n\nConformance tier: `iicp:sdk:v1` (spec S.14) · [Request a badge](https://iicp.network/conformance)\n\n---\n\n## Development\n\n```bash\npip install -e \".[dev]\"   # install with dev deps\npytest tests/ -v          # run 28 unit tests\nruff check src tests       # lint\n```\n\n---\n\n## Links\n\n- [Protocol spec](https://iicp.network/spec) — full IICP specification\n- [Node setup guide](https://iicp.network/docs/node-setup) — run your own node\n- [Error reference](https://iicp.network/docs/error-reference) — all error codes\n- [iicp-client-typescript](https://github.com/RobLe3/iicp-client-typescript) — TypeScript SDK\n- [iicp-client-rust](https://github.com/RobLe3/iicp-client-rust) — Rust SDK\n\n---\n\nApache 2.0 · [iicp.network](https://iicp.network)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froble3%2Fiicp-client-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froble3%2Fiicp-client-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froble3%2Fiicp-client-python/lists"}