This release is a pre-release and may not be stable for production use.
Swarmauri Cloudflare Workers AI LLM
swarmauri_llm_cloudflare connects Swarmauri conversations and toolkits to Cloudflare Workers AI's account-scoped REST API.
Features
- OpenAI-compatible chat completions through
CloudflareWorkersAIModel. - Tool calling through
CloudflareWorkersAIToolModelfor models that advertise tool support. - Synchronous, asynchronous, incremental streaming, and batch workflows.
- Optional discovery from Cloudflare's model-search endpoint.
- Explicit account ID and API-token configuration.
- Persistent, injectable Swarmauri HTTP clients with conservative rate-limit retries.
Installation
uv add swarmauri_llm_cloudflare
pip install swarmauri_llm_cloudflare
Usage
import os
from swarmauri_llm_cloudflare import CloudflareWorkersAIModel
from swarmauri_standard.conversations.Conversation import Conversation
from swarmauri_standard.messages.HumanMessage import HumanMessage
conversation = Conversation(messages=[HumanMessage(content="Explain edge inference.")])
model = CloudflareWorkersAIModel(
account_id=os.environ["CLOUDFLARE_ACCOUNT_ID"],
api_key=os.environ["CLOUDFLARE_API_TOKEN"],
name="@cf/meta/llama-3.3-70b-instruct-fp8-fast",
)
model.predict(conversation)
print(conversation.get_last().content)
Set discover_models=True to query the current Workers AI model catalog. For tools, instantiate CloudflareWorkersAIToolModel with a tool-capable model and pass a Swarmauri Toolkit.
Pass an IHttpClient as http_client to integrate a custom transport or to test without network access. Pass an IHttpRetryPolicy as retry_policy to replace the default policy, which retries safe reads and rate-limited chat submissions without replaying failed POST requests for generic server errors.
See the Cloudflare Workers AI REST guide and model-search API for account setup and current model details.
Metadata
Release files for swarmauri_llm_cloudflare 0.11.0.dev2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| swarmauri_llm_cloudflare-0.11.0.dev2.tar.gz | 4.4 kB | Without provenance | Details for swarmauri_llm_cloudflare-0.11.0.dev2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| swarmauri_llm_cloudflare-0.11.0.dev2-py3-none-any.whl | Python 3 | none | any | Details for swarmauri_llm_cloudflare-0.11.0.dev2-py3-none-any.whl |
Total release size: 11.9 kB
Release files / swarmauri_llm_cloudflare-0.11.0.dev2.tar.gz
| Download URL | swarmauri_llm_cloudflare-0.11.0.dev2.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
83dd89fcc94a3363405a3f40cc6fe782055901e7e23f3bfc8e9c6e4973e484f0
|
|
BLAKE2b-256 checksum How to use checksums |
47f94770843ff8302764f601b0b3cfd968d999dfe47ab63a82ce17726635ec8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / swarmauri_llm_cloudflare-0.11.0.dev2-py3-none-any.whl
| Download URL | swarmauri_llm_cloudflare-0.11.0.dev2-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f1bd0dac253cc0cb66ecc609148a74c4764b191248db4020d57afa45db1b6be
|
|
BLAKE2b-256 checksum How to use checksums |
934b8924ba5a35928e43fe8d2fd7ccb5995347b7bab56418193bd24a95b51b23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for swarmauri_llm_cloudflare 0.11.0.dev2
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.