Beru for Python
The official Python client for Beru: answers rooted in your documents, with citations and per-user memory.
pip install beru-ai # imported as `beru`
Get an API key
You need a Beru account and a key before the client can make a call.
-
Sign in at beru.airesearchlabs.si with Google. Signing in creates your account.
-
Under Billing, choose a plan (from $9 a month) or enter a coupon code.
-
Open your project → API keys → Create key. Copy the key: it's shown once.
-
Set it on your server, never in a browser or app:
export BERU_API_KEY="beru_sk_…"
The quickstart walks through your first upload and answer.
Use it
from beru import Beru
beru = Beru() # reads BERU_API_KEY; see "Get an API key" above
with open("handbook.pdf", "rb") as f:
document = beru.documents.upload(f, filename="handbook.pdf")
beru.documents.wait_until_ready(document["id"])
answer = beru.answer("How many days of annual leave do I get?", end_user_id="user_123")
print(answer["answer"])
for citation in answer["citations"]:
print(citation["number"], citation["document_title"], citation["page_from"])
# A follow-up in the same conversation
follow_up = beru.answer(
"And part-time staff?",
end_user_id="user_123",
conversation_id=answer["conversation_id"],
)
Stream an answer as it's written:
for event in beru.answer_stream("Is parking free?"):
if event.type == "delta":
print(event.text, end="", flush=True)
else:
print("\nSources:", event.answer["citations"])
AsyncBeru has the same methods, awaited:
from beru import AsyncBeru
async with AsyncBeru() as beru:
answer = await beru.answer("Is parking free?")
What's included
| Method | API |
|---|---|
documents.upload, add_url, list, get, delete, wait_until_ready |
/v1/documents |
retrieve (for your own model), answer, answer_stream, feedback |
/v1/retrieve, /v1/answer, /v1/feedback |
memories.add, extract, list, delete |
/v1/memories |
end_users.erase |
/v1/end-users/{id} |
usage |
/v1/usage |
Responses are typed dictionaries (beru.types) generated from Beru's OpenAPI file.
Errors and retries
Every error is a BeruError with code (for example plan_limit_exceeded), status, message
and request_id. Rate limits (429) are retried, honouring Retry-After; reads and uploads are also
retried after timeouts and temporary outages. Uploads carry an Idempotency-Key, so a retry never
uploads twice. Set max_retries=0 to turn retries off.
Docs: docs.airesearchlabs.si · Support: support@airesearchlabs.si
Metadata
Release files for beru-ai 0.1.1
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 |
|---|---|---|---|---|
| beru_ai-0.1.1.tar.gz | 43.0 kB | Without provenance | Details for beru_ai-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| beru_ai-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for beru_ai-0.1.1-py3-none-any.whl |
Total release size: 54.8 kB
Release files / beru_ai-0.1.1.tar.gz
| Download URL | beru_ai-0.1.1.tar.gz |
|---|---|
| Size | 43.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
63971f75a8e1b55fd4dfdd5d23f70943e8c5af3658113082b19e63ef7ecc6fec
|
|
BLAKE2b-256 checksum How to use checksums |
1c28c6ea2086da1147b3192cf65d60e460f9c28d91ee0730c928276cce55b202
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / beru_ai-0.1.1-py3-none-any.whl
| Download URL | beru_ai-0.1.1-py3-none-any.whl |
|---|---|
| Size | 11.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
531d0dc811b4b775c667328d08afee858b002724ba6869e9688a15a23ea85ec1
|
|
BLAKE2b-256 checksum How to use checksums |
107fa8f0a3ff5f31a0943753a3ca912058ece6ad11e2501395a8e9956073b054
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for beru-ai 0.1.1
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.