Drop-in observability and guardrails for AI agents.
Project description
Lightsei
Drop-in observability and guardrails for AI agents.
pip install lightsei
import lightsei
import openai
lightsei.init(api_key="bk_...", agent_name="my-bot")
oai = openai.OpenAI() # auto-instrumented after init()
@lightsei.track
def reply(prompt: str) -> str:
return oai.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": prompt}],
).choices[0].message.content
That's it. Every call now appears at app.lightsei.com with timestamps, model, latency, and token counts. No instrumentation, no manual wrapping.
What you get
- Observability — runs, events, costs, errors. Out of the box for OpenAI and Anthropic; one line of code per provider.
- Guardrails — daily cost caps, output validators (schema + content rules), behavioral checks. Caught before delivery, visible in the dashboard.
- Polaris — a project orchestrator bot you can deploy via Lightsei's
PaaS. Reads your
MEMORY.md+TASKS.mdand proposes the next moves. - Notifications — Slack, Discord, Teams, Mattermost, generic webhook. Polaris's plans land in your team chat, validation failures page you, agent crashes get reported.
- Graceful degradation, non-negotiable — if Lightsei's backend is unreachable or rejects an event, your bot keeps running. SDK never crashes the user's program.
Configuration
lightsei.init(
api_key="bk_...", # your workspace key from app.lightsei.com
agent_name="my-bot", # appears in dashboard + cost rollups
version="0.1.0", # optional — tags events
base_url="https://api.lightsei.com", # default
)
Sign up for a workspace API key at app.lightsei.com/signup.
Deploying bots on Lightsei
lightsei deploy ./my-bot --agent my-bot
Zips the directory, uploads to Lightsei's hosted runtime, builds a venv
from requirements.txt, runs bot.py. Logs stream into the dashboard.
Links
- Dashboard: app.lightsei.com
- API: api.lightsei.com
- Repository: github.com/bewallace01/lightsei
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lightsei-0.1.4.tar.gz.
File metadata
- Download URL: lightsei-0.1.4.tar.gz
- Upload date:
- Size: 37.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1604db1cfb7634dc6cb63055a0c3b6ac3f0ae72716b723b1aa9fb0770e43ae1
|
|
| MD5 |
d6e68ed7bcc05a8e271b7ba1885206d5
|
|
| BLAKE2b-256 |
03c289aceb51f00d208702560774f88aca36635beb3531a01399e900853175eb
|
File details
Details for the file lightsei-0.1.4-py3-none-any.whl.
File metadata
- Download URL: lightsei-0.1.4-py3-none-any.whl
- Upload date:
- Size: 35.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a49db6d39ff667700a2bea241f1e56697e5fcfb2bd16bc8ba358619ddb95d6c
|
|
| MD5 |
4c3a38d63e8f3ce9378d069ba9b86806
|
|
| BLAKE2b-256 |
c1e83c1d06505466006f7f07ea89b982d3f5dc003034a993ce22c4f38896e2e1
|