UltraFlow
轻量级 LLM 应用可观测性 SDK — 调用追踪、提示词工程、批量处理。
特性
- Prompty — 将
.prompty文件作为无状态函数执行(同步 / 异步 / 流式) - Tracing —
@trace装饰器自动采集调用树,业务代码零侵入 - 批量处理 —
FlowProcessor并发执行批量任务 - CLI —
uf init、uf new、uf run,快速上手
安装
pip install UltraFlow
快速开始
1. 初始化项目
uf init my-project
cd my-project
2. 执行 Prompty
from ultraflow import Prompty
translate = Prompty("translate.prompty")
result = translate(text="Hello, world!")
3. 添加调用追踪
from ultraflow import Prompty, configure_tracing, shutdown_tracing, trace
configure_tracing(endpoint="http://localhost:8031")
@trace(kind="flow")
def translate_flow(text: str) -> str:
prompty = Prompty("translate.prompty")
return prompty(text=text)
result = translate_flow(text="Hello!")
shutdown_tracing()
4. 批量处理
from ultraflow import Prompty, FlowProcessor
translate = Prompty("translate.prompty")
processor = FlowProcessor(translate, "data.json", max_workers=5)
results = processor.run()
CLI 命令
| 命令 | 说明 |
|---|---|
uf init [PROJECT] |
初始化项目,生成配置和示例 prompty |
uf new FLOW_NAME |
创建 .prompty + .json 模板 |
uf run FLOW_NAME |
运行流程(自动查找同名 .json) |
uf run FLOW -d DATA -w N |
指定数据文件和并发数 |
uf connection init |
生成连接配置模板 |
uf connection list |
显示当前生效的连接配置 |
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ultraflow-1.0.8.tar.gz
(28.8 kB
view details)
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
ultraflow-1.0.8-py3-none-any.whl
(25.2 kB
view details)
File details
Details for the file ultraflow-1.0.8.tar.gz.
File metadata
- Download URL: ultraflow-1.0.8.tar.gz
- Upload date:
- Size: 28.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
pdm/2.26.7 CPython/3.12.11 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e58a13e62d2f41792b907178174c652da9b4f5245d66021d3bd527384d2ac804
|
|
| MD5 |
03b3c2df7eaf679562e04412b521a8c7
|
|
| BLAKE2b-256 |
b361ae4b4a9b3d45bbf9dbe8db8d78c2bd871e1de8f061e9063625ea65154ac3
|
File details
Details for the file ultraflow-1.0.8-py3-none-any.whl.
File metadata
- Download URL: ultraflow-1.0.8-py3-none-any.whl
- Upload date:
- Size: 25.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
pdm/2.26.7 CPython/3.12.11 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93c87b0609b5eef46ffe0f94251282a3929fc95d4d08ae8204877e2a4fa602fb
|
|
| MD5 |
0fb2abf6087735d50d42c5b1979da2bb
|
|
| BLAKE2b-256 |
f3940d72216b15e1fe33d44837eb718c4d4c3e02be43f794e17301911a2e0723
|