Skip to main content

pybragi is web server framework

  • tronado http&websocket impl
    • flask way
    • fastapi way
  • service-discovery and service-register
    • mongo way
    • consul way
  • graceful shutdown
  • prometheus metrics
  • benchmark tools for openai_api and http_api
  • kafka producer and consumer
    • sliding window

commandline

# simple server
python -m pybragi.base.base_handler --port=1122      

# system info     eth0 ipv4/disk/memory/gpu
python -m pybragi.base.ps
# http prof
python -m pybragi.bench.http_prof --url http://10.121.0.11:18000/healthcheck --num=100 --qps=40
python -m pybragi.bench.http_prof --url http://10.121.0.11:19000/v1/chat/completions --method=POST -H "Content-Type: application/json" --body='{"model": "Qwen3-235B-A22B", "messages": [{"role": "user", "content": "你好"}], "stream": false}' --num=10 --qps=3


# llm openai
python -m pybragi.bench.llm_openai --qps=2 --url=http://localhost:30000 --api-key=aaabbb --jsonl-file=https://xxx.com/queue-2025-05-12.jsonl --num=10 --model=qwen3_235b_0419_25k  --metrics-dir='/home/cxj/self/py3_server/output'

python -m pybragi.bench.llm_openai --show-metrics-pkl='/output/llm_openai_2025-05-12T15-48-27.pkl'


| 统计类型 | prompt_len | output_len | 端到端 | ttft | itl |
|---------|-----------|-----------|-------|------|-----|
| 平均值 | 8172.300 | 235.500 | 5170.644 | 306.232 | 95.763 |
| 中位数 | 8327.000 | 237.500 | 5211.785 | 305.749 | 89.392 |
| 99分位 | 9312.820 | 270.640 | 6036.196 | 339.780 | 125.736 |
| 最大值 | 9331.000 | 271.000 | 6069.074 | 340.317 | 127.126 |



# server dao_server_discovery

python -m pybragi.server.dao_server_discovery --mongo-url "mongodb://aa:bb@127.0.0.1:3717/?authSource=llm&retryWrites=true" --mongo-db=llm --action=show_type --model-type=openai

# --mongo-db=llm --action=show --model-type=openai # openai同步流式调用

# --mongo-db=llm --action=show_type_online # api+回调
# --mongo-db=llm --action=show_type_online --model-type=openai # openai同步流式调用

# --mongo-db=llm --action=show_type # api+回调
# --mongo-db=llm --action=show_type --model-type=openai # openai同步流式调用

# --mongo-db=llm --action=show_all_online # 完全所有
# --mongo-db=llm --action=show_all # 完全所有

Metadata

Release files for pybragi 0.0.21.post2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pybragi 0.0.21.post2
File Interpreter ABI Platform Actions
pybragi-0.0.21.post2-py3-none-any.whl Python 3 none any Details for pybragi-0.0.21.post2-py3-none-any.whl

Release files / pybragi-0.0.21.post2-py3-none-any.whl

Download URL pybragi-0.0.21.post2-py3-none-any.whl
Size 71.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7dce3d9d1b77405341d2da1e85349fb8b81c46beecad216c43ca45a5bbcb6b7b
BLAKE2b-256 checksum
How to use checksums
9163db417247d96d9ac4017467ee1666628aa201de6ca8025f699e1e4f7f65fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Security for pybragi 0.0.21.post2

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.

Release history Release notifications | RSS feed

This release

0.0.21.post2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page