Skip to content

Deployment and Configuration

Except for the frontend, the Gateway and every engine are deployed as containers, on the same machine, on the LAN or remotely. The frontend is not containerised; each platform packages it with its own native toolchain.

The Gateway reads a TOML file. An example is deploy/gateway.example.toml in the project repository:

终端窗口
pinshuo-gateway --config deploy/gateway.example.toml
  • [gateway] listen: the address the frontend connects to, written as unix:/absolute/path or tcp:127.0.0.1:port. TCP accepts loopback addresses only.
  • [[backend]]: one entry per engine. id is unique within the file, and address is written as unix:/absolute/path or tcp:host:port (use the service name between containers).
  • The tuning entries are in milliseconds, range 1 to 3600000: request_timeout_ms (default 500), connect_timeout_ms (1000), health_interval_ms (1000), retry_initial_ms (200), retry_max_ms (5000).

A missing required entry, a malformed address, an out-of-range value, a duplicate engine id, no engine at all, or an unknown field is reported as a clear error. Nothing silently falls back to a default.

Exit codes: 0 normal exit; 1 start failure (for example two engines declare the same capability); 2 invalid command line or configuration, nothing started.

One directory per engine and one container per directory, each with its own Containerfile. The Doubao engine is one container that declares both pinyin and voice, so it is registered once in the Gateway configuration. Both of its capabilities share one Wine-hosted Doubao engine, so pinyin and voice cannot run at the same time.

For testing: the fake engine and the Doubao engine both declare pinyin and voice, and registering both makes the start fail with a conflict. Keep only one.