This release is a pre-release and may not be stable for production use.
Brevia
Python library for AI applications. Define typed activities; Brevia handles model calls, validated output, configuration, durable jobs, files and access control. Your application owns the business logic.
Beta, for controlled internal use · Python 3.12+ · PostgreSQL · On PyPI as a pre-release: brevia==1.0.0b1
What works today
- OpenAI, Anthropic and Ollama models, structured output, retries and run limits.
- Configuration overrides, prompt templates and a snapshot of each run.
- Direct execution or queued jobs with cancellation, retry and worker recovery.
- Input files from allowed HTTPS hosts, output files and automatic cleanup.
- JWT authentication, per-caller access, usage tracking and optional traces.
- An HTTP API for activities, runs and jobs, configuration, prompts and feedback, on which the application adds its own endpoints.
- PDF, DOCX and text readers,
map_reduceandrefineover long documents, the readysummarizeandextractactivities and tools the model may call.
An interrupted job restarts its activity from the beginning: external effects must tolerate repetition. What the beta leaves out, and what may still change before 1.0 (real models verified with OpenAI only; the database schema), is on the documentation home. See implementation status for guarantees and limits.
Use it in your application
Start a new application from the project template:
uvx copier copy --vcs-ref v1.0.0b1 gh:brevia-ai/brevia my-project
It has one working activity, its HTTP API, a worker, tests with a fake model, a development database and a container image that runs the worker and the API. To add Brevia to an existing project instead, install it from PyPI, pinned to a release, using uv:
uv add "brevia==1.0.0b1"
1.0 is a pre-release: pip install brevia or uv add brevia without a version still
installs Brevia 0.15.
Follow Getting started for a complete working example: configure the database and a model, register an activity, then run it from Python. For background execution, use the job example.
Develop Brevia
From this repository:
uv sync --locked
cp .env.example .env
The example points to the local database in compose.yaml. To use it:
docker compose up -d --wait
uv run brevia db upgrade
Set a provider key in .env only when calling a real model. Load it into the process
with uv run --env-file .env python your_script.py. For development without model
calls, see fake models.
Configuration
| Where | What belongs there |
|---|---|
.env |
Database URL, credentials and installation settings |
brevia.toml |
Models, run limits and activity defaults |
| Application code | Activities, input/output schemas and business logic |
.env.example contains the common options; omitted settings use
their defaults. See all settings,
worker settings and
authentication when needed.
Checks
uv run ruff format --check
uv run ruff check
uv run mypy
uv run pytest
Unit tests need no services or provider keys. Integration and real-model tests are separate: see Contributing.
Documentation site
Guides and API reference are built from docs/ and the docstrings:
uv run --group docs zensical serve # preview at http://localhost:8000, reloads on changes
uv run --group docs zensical build --strict # build into site/, failing on broken links
Add --open to serve to open the browser, or --dev-addr 0.0.0.0:8001 for another
address or port.
| Need | Read |
|---|---|
| Run and operate jobs | Jobs · Workers |
| Handle documents and permissions | Files · Access |
| Use the Python API | API reference |
| Check progress and changes | Implementation status · Changelog |
| Contribute | Contributing · Agent instructions |
Licence and compatibility
MIT. Brevia 1.0 is a new design; projects using Brevia 0.15 require a separate migration.
Metadata
Release files for brevia 1.0.0b1
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 |
|---|---|---|---|---|
| brevia-1.0.0b1.tar.gz | 580.2 kB | Without provenance | Details for brevia-1.0.0b1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| brevia-1.0.0b1-py3-none-any.whl | Python 3 | none | any | Details for brevia-1.0.0b1-py3-none-any.whl |
Total release size: 738.8 kB
Release files / brevia-1.0.0b1.tar.gz
| Download URL | brevia-1.0.0b1.tar.gz |
|---|---|
| Size | 580.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8da3ca77e55905fd71fd2368332e1cd395934d0ee662096d02ffccde9f54ca39
|
|
BLAKE2b-256 checksum How to use checksums |
1b783e3b76dddb545ef2a6fe6335162d4cacb8d9f48d0b9b03c3764f820643e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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 / brevia-1.0.0b1-py3-none-any.whl
| Download URL | brevia-1.0.0b1-py3-none-any.whl |
|---|---|
| Size | 158.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
78f38e1d7aa4b8a9d0c91465dcbca24b4e38eded39d7b705760b0325e79855e9
|
|
BLAKE2b-256 checksum How to use checksums |
dfabe69ffe18a55d2da9f86cee15e25f22a96322f669fa97d9d7ae0c2ce6a516
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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 brevia 1.0.0b1
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.