Skip to main content

brewer-nash-dispatcher

A session-affinity dispatcher for AI workers, inspired by the dynamic access-history mechanism of the Brewer-Nash (Chinese Wall) security model.

一个面向 AI Worker 的会话亲和调度器,灵感来自 Brewer-Nash(中国墙) 安全模型的动态访问历史机制。

The core idea: isolation is triggered only by information asymmetry. Workers with identical history are interchangeable; a worker holding non-empty history is walled off from unrelated new tasks. Fresh tasks target the zero-information state, so only workers with empty history qualify.

核心思想:只有信息不对称才触发隔离。 history 完全相同的 worker 可以互换;持有非空 history 的 worker 不能接不相关的新任务。新任务的目标状态是“零信息”,因此只有 history=[] 的全新 worker 才有资格。


Install / 安装

pip

pip install brewer-nash-dispatcher

Quick start / 快速开始
Three processes, three terminals. 三个进程,三个终端。

bash
# 1. Start the dispatcher
brewer-nash-dispatcher --host 127.0.0.1 --port 9000

# 2. Attach one (or more) workers — any client that opens a WS to /ws
#    A reference worker is bundled for testing:
python -m fake_agent --url ws://127.0.0.1:9000/ws

# 3. Start the OpenAI-compatible gateway
brewer-nash-dispatcher-openai-apikey-server --host 127.0.0.1 --port 8001
Now point any OpenAI SDK at http://127.0.0.1:8001/v1:

现在可以用任意 OpenAI SDK 指向 http://127.0.0.1:8001/v1:

python
from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8001/v1", api_key="sk-doubao-demo-123456")

stream = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello"}],
    stream=True,          # required — only streaming is supported
)

Metadata

Release files for brewer-nash-dispatcher 0.1.2

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

Source distribution (sdist)

Source distribution for brewer-nash-dispatcher 0.1.2
File Size Uploaded Provenance Actions
brewer_nash_dispatcher-0.1.2.tar.gz 11.0 kB Without provenance Details for brewer_nash_dispatcher-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for brewer-nash-dispatcher 0.1.2
File Interpreter ABI Platform Actions
brewer_nash_dispatcher-0.1.2-py3-none-any.whl Python 3 none any Details for brewer_nash_dispatcher-0.1.2-py3-none-any.whl

Total release size: 23.9 kB

Release files / brewer_nash_dispatcher-0.1.2.tar.gz

Download URL brewer_nash_dispatcher-0.1.2.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cb93a414719fe42069409c475436d3545f7da0608012799e033a0ec9b2e33059
BLAKE2b-256 checksum
How to use checksums
ae71b1bde94415aa75c1f721ea28d6557f77af89eded6c1780d2f998bc97fcc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Release files / brewer_nash_dispatcher-0.1.2-py3-none-any.whl

Download URL brewer_nash_dispatcher-0.1.2-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f6199febb724b6ad18dfde1aae5d846eb5fe2239e3db5d51cc27344ba741450
BLAKE2b-256 checksum
How to use checksums
8b0eb14248b0364cd60ced07bc46c6711050816ad8ad3372ddb6f5893983b782
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Security for brewer-nash-dispatcher 0.1.2

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.

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