Skip to main content

Typed Python client SDK for the Arcanada Model Connector — unified API for AI CLI agents and cloud model providers.

Project description

arcanada-model-connector

PyPI Python License: MIT

Typed Python client SDK for the Arcanada Model Connector — a unified API for AI CLI agents (Claude Code, Cursor, Gemini, Codex) and cloud model providers (OpenRouter, Groq, Grok, embedding services).

pip install arcanada-model-connector

Quick start

from arcanada_model_connector import Client

client = Client(api_key="arc_api_...")
response = client.execute({
    "connector": "openrouter",
    "prompt": "Explain BGE-M3 in 30 words.",
    "model": "mistralai/mistral-small-3.2-24b-instruct",
})
print(response.result)

Async

import asyncio
from arcanada_model_connector import AsyncClient

async def main() -> None:
    async with AsyncClient(api_key="arc_api_...") as client:
        response = await client.execute({"connector": "openrouter", "prompt": "ping"})
        print(response.result)

asyncio.run(main())

Structured output with output_format + schema

response = client.execute({
    "connector": "openrouter",
    "prompt": "Return a JSON object with keys 'city' and 'population'.",
    "output_format": "json",
    "schema": {
        "type": "object",
        "properties": {
            "city": {"type": "string"},
            "population": {"type": "integer"},
        },
        "required": ["city", "population"],
    },
})
print(response.repair_report)  # native | guarded | failed
print(response.structured)

repair_report.pass_ is one of:

  • native — provider returned valid output, no repair needed.
  • guarded — output-guard middleware applied repair strategies successfully.
  • failed — output-guard exhausted retries; raised as GuardExhaustedError.

Error handling

from arcanada_model_connector import ConnectorError, GuardExhaustedError, TimeoutError

try:
    response = client.execute({"connector": "openrouter", "prompt": "..."})
except GuardExhaustedError as exc:
    print("guard exhausted:", exc.envelope.message)
except ConnectorError as exc:
    print(f"HTTP {exc.status}: {exc.envelope.type if exc.envelope else 'unknown'}")
    if exc.retry_after:
        print(f"retry after {exc.retry_after}s")
except TimeoutError as exc:
    print("timed out after", exc.timeout, "seconds")

The SDK redacts Authorization headers and Bearer tokens from exc.cause before raising, so safe to log.

Documentation

License

MIT © Arcanada


Жизнь одного человека имеет значение / One human life matters

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

arcanada_model_connector-0.1.1.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

arcanada_model_connector-0.1.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file arcanada_model_connector-0.1.1.tar.gz.

File metadata

  • Download URL: arcanada_model_connector-0.1.1.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for arcanada_model_connector-0.1.1.tar.gz
Algorithm Hash digest
SHA256 30a678638672ce315e46fe333f85585e7ece15ff602db11c81ab3f7b4bfd7956
MD5 4141d940e625f517d8159edaa223d016
BLAKE2b-256 610c3dc82671f5031e7110fd0f1f2c9bddb5ba546362b2a42aa4d15c6ee87866

See more details on using hashes here.

Provenance

The following attestation bundles were made for arcanada_model_connector-0.1.1.tar.gz:

Publisher: publish-sdks.yml on Arcanada-one/model-connector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arcanada_model_connector-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for arcanada_model_connector-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dffc6a9bc1a1437622c6f81ed674771d1529c7fd6a05b930a073f0e1ece43bb8
MD5 7c485c90eca6687244bfd227037a4de5
BLAKE2b-256 5d414b013ce5798ffcac373eb5a620c3aa86ce05ac38962cf6cfc06a55bddba3

See more details on using hashes here.

Provenance

The following attestation bundles were made for arcanada_model_connector-0.1.1-py3-none-any.whl:

Publisher: publish-sdks.yml on Arcanada-one/model-connector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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