YunZhi UEBA receiver for SiteLLM callback events
Project description
YunZhi UEBA Receiver
接收 SiteLLM YunZhi UEBA 回调事件的轻量级服务,支持实时和批量两种发送模式的验证。
快速开始
# 1. 安装依赖
# pip install fastapi uvicorn jinja2 httpx python-dotenv pydantic
pip install yunzhi-ueba-receiver
# 2. 配置 (可选)
# 编辑 .env 文件,修改端口和 API Key
YUNZHI_RECEIVER_PORT=9090
YUNZHI_RECEIVER_API_KEY=test-key
YUNZHI_RECEIVER_DB_PATH=../ueba_events.db
YUNZHI_RECEIVER_LOG_LEVEL=INFO
YUNZHI_RECEIVER_MAX_EVENTS=100000
YUNZHI_RECEIVER_REFRESH_MS=5000
# 3. 启动服务
python -m receiver.main
服务启动后:
- API 端点:
http://localhost:9090 - Web UI: 浏览器打开
http://localhost:9090 - 健康检查:
GET /api/health
配置
| 环境变量 | 默认值 | 说明 |
|---|---|---|
YUNZHI_RECEIVER_PORT |
9090 |
HTTP 服务端口 |
YUNZHI_RECEIVER_API_KEY |
test-key |
接收端认证密钥 |
YUNZHI_RECEIVER_DB_PATH |
./ueba_events.db |
SQLite 数据库路径 |
YUNZHI_RECEIVER_MAX_EVENTS |
100000 |
最大存储条数 |
测试
# 启动接收端后,另一个终端运行:
python scripts/test_sender.py --receiver-url http://localhost:9090 --api-key test-key
与 siteLLM 对接
UI上添加日志回调或在 siteLLM 的 config.yaml 中配置:
Realtime 模式
litellm_params:
callbacks:
- yunzhi_ueba
yunzhi_ueba_callback_config:
YUNZHI_UEBA_API_BASE: "http://localhost:9090"
YUNZHI_UEBA_API_KEY: "test-key"
YUNZHI_UEBA_MODE: "realtime"
Batch 模式
yunzhi_ueba_callback_config:
YUNZHI_UEBA_API_BASE: "http://localhost:9090"
YUNZHI_UEBA_API_KEY: "test-key"
YUNZHI_UEBA_MODE: "batch"
YUNZHI_UEBA_BATCH_SIZE: 20
YUNZHI_UEBA_FLUSH_INTERVAL: 30
API 文档
POST /api/events — 接收事件
请求体:
{
"events": [
{
"event": "completion",
"topic": "UEBA-Agent",
"sitellm_payload": { ...完整 StandardLoggingPayload... }
}
]
}
响应:
{"received": 1, "errors": []}
GET /api/query — 查询事件
参数:model, provider, status, session_id, user, startTime, endTime, page, limit
GET /api/health — 健康检查
响应:{"status": "healthy"}
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
File details
Details for the file yunzhi_ueba_receiver-0.1.9.tar.gz.
File metadata
- Download URL: yunzhi_ueba_receiver-0.1.9.tar.gz
- Upload date:
- Size: 23.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56bb1f8beb431fe7ea925c7e9d088eb1a39abad61f52c4ca58481d47cc269e9b
|
|
| MD5 |
50bbbc453a01ce5ad6338a9fa27e2adf
|
|
| BLAKE2b-256 |
f48238f223e54e8afc023d5f7c551eee260bb8ae534164c52fae0e25f89dfffc
|