Skip to main content

cteno-sdk (Python)

Run Cteno agents from Python — same protocol and shape as the Node package @cteno/sdk. Standard library only, Python ≥ 3.9, asyncio.

The PyPI package is coming soon (with Cteno 2.10.12). Until then, install from source with pip install ./python and point the SDK at a daemon: see the repository README, "Use from source".

The platform wheels (planned: macOS arm64/x64, Linux x64 with glibc ≥ 2.34, Windows x64; Linux arm64 is not supported yet) include the Cteno daemon. CtenoSession.open() starts it in local mode on first use: no desktop app, no account, your own model key.

Install

# coming soon — not published yet
pip install cteno-sdk

On a platform without a wheel pip falls back to the sdist, which has no daemon: set CTENO_SDK_DAEMON_PATH to a cteno-host-cli binary, or pass socket_path to a daemon you run yourself.

Quickstart

import asyncio, os
from cteno_sdk import CtenoSession

async def main():
    async with await CtenoSession.open() as cteno:          # starts the bundled daemon if needed
        await cteno.configure_model(base_url="https://api.openai.com/v1", model="gpt-4.1-mini",
                                    api_key=os.environ["OPENAI_API_KEY"])   # once; stays the default
        sid = await cteno.create(cwd=".")
        result = await cteno.run(sid, "Reply with exactly: hello from Cteno")
        print(result.text if result.ok else result.error)   # hello from Cteno
        await cteno.close_session(sid)

asyncio.run(main())

Tools that are not read-only are denied at once unless you approve them:

result = await cteno.run(sid, "Run the tests", can_use_tool=lambda req: req["tool_name"] == "Bash")

can_use_tool may be async and may return {"allow": False, "reason": "..."}. The daemon keeps running after your process exits; await stop_daemon() stops it.

Your own agent

import asyncio
from cteno_sdk import CtenoSession, AgentSpec, ClientTool

async def search_places(args, ctx):          # runs in YOUR process
    return {"name": "Quiet Corner Cafe", "keyword": args["keyword"]}

async def main():
    async with await CtenoSession.open() as cteno:      # bundled daemon, or open("/path/to/host.sock")
        sid = await cteno.create(model="my-profile", spec=AgentSpec(
            system_prompt="You are a city guide.",
            tools={"allow": []},
            client_tools=[ClientTool("search_places", "Search places",
                                     {"type": "object", "properties": {"keyword": {"type": "string"}},
                                      "required": ["keyword"]},
                                     handler=search_places)],
            limits={"maxIterations": 10, "turnTimeoutMs": 60_000},
        ))
        result = await cteno.run(sid, "Somewhere quiet for coffee?", timeout=90)
        print(result.ok, result.text, result.tool_calls)
        await cteno.close_session(sid)

asyncio.run(main())

AgentSpec (custom prompt, client tools, terminal tools, output schema, limits, history, tenant) is supported by the bundled daemon; with an explicit socket_path to another daemon it needs ≥ 2.10.10 ("sdk-session-spec-v1" in await cteno.capabilities()). See the repository README for authentication and compatibility, and the Node README for the full spec field reference (same fields, snake_case here).

Tests

python -m unittest discover -s tests

License

MIT. The daemon binaries under cteno_sdk/_bin are not MIT; see cteno_sdk/_bin/LICENSE.daemon in the wheel.

Metadata

Release files for cteno-sdk 2.10.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cteno-sdk 2.10.13
File Size Uploaded Provenance Actions
cteno_sdk-2.10.13.tar.gz 23.5 kB Without provenance Details for cteno_sdk-2.10.13.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for cteno-sdk 2.10.13
File Actions
cteno_sdk-2.10.13-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for cteno_sdk-2.10.13-py3-none-win_amd64.whl
cteno_sdk-2.10.13-py3-none-manylinux_2_34_x86_64.whl Python 3 none Linux glibc 2.34+ x86-64 Details for cteno_sdk-2.10.13-py3-none-manylinux_2_34_x86_64.whl
cteno_sdk-2.10.13-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for cteno_sdk-2.10.13-py3-none-macosx_11_0_arm64.whl
cteno_sdk-2.10.13-py3-none-macosx_10_15_x86_64.whl Python 3 none macOS 10.15+ x86-64 Details for cteno_sdk-2.10.13-py3-none-macosx_10_15_x86_64.whl

Total release size: 264.8 MB

Release files / cteno_sdk-2.10.13.tar.gz

Download URL cteno_sdk-2.10.13.tar.gz
Size 23.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4b179c0e392263debdb8c10b9fb00b4436774e84c1a5b1f069ddd6befda0d2c9
BLAKE2b-256 checksum
How to use checksums
9b994aeb4592de23b9671ea7add7910868df979ace36e67fb3e1b1c999e3a8b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / cteno_sdk-2.10.13-py3-none-win_amd64.whl

Download URL cteno_sdk-2.10.13-py3-none-win_amd64.whl
Size 53.4 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
6a4b967d24241c9fa6e4133f810e6c15a854d2765734ca92d3d9843d14ca4f7f
BLAKE2b-256 checksum
How to use checksums
806e8e96ffe27a46d689447c92789befc1153fdbd48c6ab51aca4fd946a36a5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / cteno_sdk-2.10.13-py3-none-manylinux_2_34_x86_64.whl

Download URL cteno_sdk-2.10.13-py3-none-manylinux_2_34_x86_64.whl
Size 49.8 MB
Tags Linux glibc 2.34+ x86-64 Python 3
SHA-256 checksum
How to use checksums
d261e4a9ac34ace8aab7117b1da26188272980a0963e1683cf79221b699e11ed
BLAKE2b-256 checksum
How to use checksums
c9665445abac7a45a9a847d5245f2b7d928cf3c2d2390ce881990f5e01cb3470
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / cteno_sdk-2.10.13-py3-none-macosx_11_0_arm64.whl

Download URL cteno_sdk-2.10.13-py3-none-macosx_11_0_arm64.whl
Size 80.4 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
06bd7751619ce94181b9ba1b686bef3b0ebb73cf7bc4a08aed636e4237f3fa01
BLAKE2b-256 checksum
How to use checksums
e1434f4780d60ed16517619cb54b9aed1dbf9361a2995a5e65c3ba799a11a75e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / cteno_sdk-2.10.13-py3-none-macosx_10_15_x86_64.whl

Download URL cteno_sdk-2.10.13-py3-none-macosx_10_15_x86_64.whl
Size 81.2 MB
Tags Python 3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
b7dcace92cec428bf65967aafc3106fcda154128175ccc94886d0111795d03e7
BLAKE2b-256 checksum
How to use checksums
80e95d84bc61d8a4e4fc121736393e65e98917f88562a0d02d269ddf77f0c425
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for cteno-sdk 2.10.13

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page