Development Guide¶
Repository Areas¶
flexserv/gateway: Rust gatewayflexserv/backend/hf_transformers_backend: transformers backendflexserv/backend/utils: model helper scriptsdeploy/src: deployment helper APIspec: protocol and architecture reference assets
Recommended Workflow¶
- Create a backend Python environment in
venvs/flexserv. - Build the gateway with
PYO3_PYTHONpointed at that interpreter. - Use
./run-local.shfor end-to-end local iteration. - Use
./test_local_https_e2e.shfor broader validation.
Key Runtime Scripts¶
run-local.sh: local backend + HTTPS gateway launchertest-api.sh: starts the stack and keeps it runningtest_local_https_e2e.sh: end-to-end checks against the local HTTPS stackrun-docker.sh: host-side Docker orchestrationflexserv/boot_loader.sh: in-container backend/gateway startup
Gateway Development Notes¶
The gateway owns more than reverse proxying. If you change gateway behavior, check:
- auth bypass list in
auth.rs - readiness behavior in
health.rs - OpenAPI merging in
openapi.rs - model fetch/copy/index/unpack logic in
model_fetch.rs - model request rewriting in
model_fetch.rs
Transformers Backend Notes¶
Transformers 5.3.0 introduced a breaking change that causes issue for transformers serve, where even /v1/chat/completions and /v1/audio/transcriptions are not working properly.
The backend intentionally patches upstream transformers serve behavior:
- route rebinding for request-body compatibility
- optional trimming of unexpected fields
- cache continuation guard for multimodal turns
- transcription decoding fallback that avoids fragile librosa-only paths
- retry for known response-stream continuation bug
Validation¶
Common checks:
For focused local work:
curl -k https://127.0.0.1:8443/healthz/ready
curl -k https://127.0.0.1:8443/openapi.json | jq '.paths | keys'
Documentation Rule¶
The repository previously contained many docs for a removed flexserv CLI and YAML config flow. When updating docs, treat the gateway binary, backend server, and boot loader as the source of truth.