Deterministic API simulator for testing:
- Connection Assistant decisioning (V1 direct vs V2 proxy-required)
- Proxy parser behavior (
json,sse,ndjson,multipart) - End-to-end flow: Red Team -> Proxy -> Target Endpoint
This service intentionally focuses on response shape and streaming behavior first.
POST /sim/json/basic- Standard JSON payload with
messagefield. - Good for direct YAML generation tests.
- Standard JSON payload with
POST /sim/json/chunked-array- Returns a JSON array of token-like chunks:
[{"role":"assistant","content":"..."}, ...]
- Good for forcing V2/proxy-required decisions.
- Returns a JSON array of token-like chunks:
POST /sim/stream/sse- Server-Sent Events (
text/event-stream) withdata:JSON frames.
- Server-Sent Events (
POST /sim/stream/ndjson- NDJSON streaming (
application/x-ndjson) one JSON object per line.
- NDJSON streaming (
POST /sim/stream/multipart- Multipart mixed stream (
multipart/mixed) with JSON parts.
- Multipart mixed stream (
Utility endpoints:
GET /GET /healthzGET /scenarios
All simulation endpoints accept:
{
"prompt": "hello world",
"total_chunks": 12,
"chunk_delay_ms": 30,
"top_k": "all",
"metadata": {}
}Fields:
prompt: input text used to build deterministic response content.total_chunks: approximate number of chunks emitted for chunked/streaming scenarios.chunk_delay_ms: delay between emitted chunks (streaming endpoints).top_k: optional passthrough field for shape testing.metadata: optional passthrough object.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --host 0.0.0.0 --port 10000 --reloadcurl -sS http://127.0.0.1:10000/healthzcurl -sS -X POST http://127.0.0.1:10000/sim/json/basic \
-H 'Content-Type: application/json' \
-d '{"prompt":"Who is in the company?"}'curl -sS -X POST http://127.0.0.1:10000/sim/json/chunked-array \
-H 'Content-Type: application/json' \
-d '{"prompt":"stream this in json chunks","total_chunks":16}'curl -N -X POST http://127.0.0.1:10000/sim/stream/sse \
-H 'Content-Type: application/json' \
-d '{"prompt":"sse please","total_chunks":8,"chunk_delay_ms":40}'curl -N -X POST http://127.0.0.1:10000/sim/stream/ndjson \
-H 'Content-Type: application/json' \
-d '{"prompt":"ndjson please","total_chunks":8,"chunk_delay_ms":40}'curl -N -X POST http://127.0.0.1:10000/sim/stream/multipart \
-H 'Content-Type: application/json' \
-d '{"prompt":"multipart please","total_chunks":8,"chunk_delay_ms":40}'This repo includes:
Dockerfilerender.yaml
Create a new Render Web Service from this repo and use Docker deploy.
Health check path: /healthz.
Example profile definitions are in:
profiles.proxy.examples.json
Load into f5-ai-sec-proxy with runtime profile APIs:
curl -X POST https://<your-proxy>/profiles/upload \
-H 'X-Profile-Admin-Token: <admin-token-if-enabled>' \
-F "replace_existing=false" \
-F "file=@profiles.proxy.examples.json"Call proxy with selected profile:
curl -X POST https://<your-proxy>/ask \
-H 'Content-Type: application/json' \
-d '{
"prompt": "test chunk behavior",
"external_metadata": {
"proxy_profile": "sim_json_chunked_array"
}
}'