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 platform wheels (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

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())

base_url is used as given: include the API version (https://api.openai.com/v1, https://api.deepseek.com/anthropic/v1, https://generativelanguage.googleapis.com/v1beta); the SDK appends only the resource path. A base that is missing or repeats a version segment makes configure_model() raise SdkError naming the full URL it would have requested. result.ok is False when the turn failed (model 404/401/429, quota, timeout); result.error is the original error text and result.error_kind its class.

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.15

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.15
File Size Uploaded Provenance Actions
cteno_sdk-2.10.15.tar.gz 26.1 kB Without provenance Details for cteno_sdk-2.10.15.tar.gz

Built distributions (wheels)

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

Total release size: 269.0 MB

Release files / cteno_sdk-2.10.15.tar.gz

Download URL cteno_sdk-2.10.15.tar.gz
Size 26.1 kB
Tags Source
SHA-256 checksum
How to use checksums
be7e7a05c730a9c5ab7f69afe487b5feb38127b4cee342d68a0ed545e5aead5b
BLAKE2b-256 checksum
How to use checksums
734e4c8bbd87e020d2eb0136e83e33006e04a7a0879e04e51b9de191aff04189
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL cteno_sdk-2.10.15-py3-none-win_amd64.whl
Size 53.5 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
c0668d3d844ea612db06ab74f3aac22e3bebbae0e214f1af648d38397deac6a0
BLAKE2b-256 checksum
How to use checksums
252f5836ffa2f7dff234d4c7f051de78306284f513989af4474a31dfb3a21196
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL cteno_sdk-2.10.15-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
1ed47521563d74d7c1e51dc1d1f219f63dfb0296a7d876a219d3756f1c18d096
BLAKE2b-256 checksum
How to use checksums
11ff2a3926254b73da189a47187fa0b01bda433bcaaeba6cf2c4d244bf18d8c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL cteno_sdk-2.10.15-py3-none-macosx_11_0_arm64.whl
Size 81.3 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
898686752cb7e93a8fa89a2b32318693cbc20dce06d9ba60a035307a15a8bef1
BLAKE2b-256 checksum
How to use checksums
013bdcfefe7946c92dcdd932f7c05683d5d64853c363bd501486575c60052661
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL cteno_sdk-2.10.15-py3-none-macosx_10_15_x86_64.whl
Size 84.4 MB
Tags Python 3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
89f626737ee7b648981acdf674470f0665794b1993470863ec49c810ba61fdf6
BLAKE2b-256 checksum
How to use checksums
52f47c9ade5bc694a94b933a1998efaf44e0462fea885bdddf88818f4e69b314
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for cteno-sdk 2.10.15

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