Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Publish Python alpha
name: Publish Python pre-release
on:
workflow_dispatch:
inputs:
version:
description: Exact version in pyproject.toml
required: true
default: '0.1.0a1'
default: '0.1.0b1'
permissions:
contents: read
jobs:
Expand All @@ -25,11 +25,13 @@ jobs:
RELEASE_VERSION: ${{ inputs.version }}
run: |
python - <<'PY'
import os, tomllib
import os, re, tomllib
with open('pyproject.toml', 'rb') as f:
version = tomllib.load(f)['project']['version']
assert version == os.environ['RELEASE_VERSION'], 'release version mismatch'
assert 'a' in version, 'this workflow publishes alpha versions only'
assert re.fullmatch(r'\d+\.\d+\.\d+(a|b)\d+', version), (
'this workflow publishes alpha (aN) or beta (bN) pre-releases only'
)
PY
- run: python -m pip install build twine
- run: python -m build
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Changelog

## 0.1.0b1

First beta of the Python AI Protection SDK. The `webdecoy_ai_protection` package
API is unchanged from `0.1.0a1`; this release moves the package from alpha to beta.

- Add a runnable Ollama example (`examples/ollama_budget.py`) that wraps one
non-streaming `ollama.AsyncClient.generate` call in a per-attempt model budget,
with pinned example requirements (`examples/requirements-ollama.txt`).
- Add tests for the Ollama example against the pinned `ollama==0.6.3` Python SDK
with an in-memory HTTP transport: serialization, usage normalization, denial
before the provider, privacy, cancellation and accounting failures. `ollama` is
added to the `dev` extra only; it is not a runtime dependency.
- Document the Ollama example in the README.
- The publish workflow now accepts beta (`bN`) as well as alpha (`aN`)
pre-release versions.
- Update maturity labels and install instructions to `0.1.0b1`.

```sh
python -m pip install 'webdecoy-ai-protection[fastapi]==0.1.0b1'
```

Earlier releases are described in the
[GitHub releases](https://github.com/WebDecoy/ai-protection-python/releases).
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Async request admission for Python AI endpoints. Local application rules run in
your process; bot detection runs in WebDecoy. Apache-2.0 licensed.

**Alpha preview.** This first implementation covers
**Beta.** This release covers
admission, shared account/session quotas, reporting and an explicit FastAPI/Starlette
route wrapper, including optional concurrency leases across streamed responses.
Per-attempt model budgets and usage reporting are also available. Browser evidence
Expand All @@ -13,10 +13,10 @@ and MCP adapters are not yet implemented. It is not a prompt-injection filter or

Requires Python 3.11+ and asyncio. HTTPX is the only core runtime dependency.
FastAPI/Starlette support is optional; synchronous applications and Trio are not
supported in this preview.
supported in this beta.

```sh
python -m pip install 'webdecoy-ai-protection[fastapi]==0.1.0a1'
python -m pip install 'webdecoy-ai-protection[fastapi]==0.1.0b1'
```

For core-only applications, omit `[fastapi]`. For development from this checkout,
Expand Down Expand Up @@ -274,7 +274,7 @@ Use `BudgetCompletion(value, usage)` to preserve provider output separately from
accounting. A return value without that wrapper is preserved with unknown usage.
For streaming, consume the stream **inside** the callback and await terminal usage;
returning a `StreamingResponse` or iterator is not completion. Arrange budget
denial before committing HTTP headers. This preview has no automatic budgeted
denial before committing HTTP headers. This beta has no automatic budgeted
HTTP-streaming bridge. When composing concurrency, wrap the complete budgeted
provider attempt inside the concurrency-owned work; FastAPI's concurrency wrapper
already owns its handler and full response lifecycle.
Expand Down Expand Up @@ -363,7 +363,7 @@ not detection effectiveness, customer savings, or production capacity.

[`examples/ollama_budget.py`](examples/ollama_budget.py) wraps a real
[`ollama.AsyncClient.generate`](https://github.com/ollama/ollama-python) call
with the existing published WebDecoy SDK. Install the example dependencies:
with the published WebDecoy SDK. Install the example dependencies:

```sh
python -m pip install -r examples/requirements-ollama.txt
Expand Down
2 changes: 1 addition & 1 deletion examples/requirements-ollama.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
webdecoy-ai-protection==0.1.0a1
webdecoy-ai-protection==0.1.0b1
ollama==0.6.3
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "webdecoy-ai-protection"
version = "0.1.0a1"
version = "0.1.0b1"
description = "Async request admission for Python AI endpoints using WebDecoy"
readme = "README.md"
requires-python = ">=3.11"
Expand Down
Loading