Testing with stub responses
To test your product without calling real models, ask the operator to turn on a stub for your product, optionally for one subject (exact, or ending in *). With no stub set up, nothing changes.
The stub replaces the models, not the service. Your key, the limits, the ladder, the status codes and the accounting stay real.
A stub response is always recognizable: stub: true, model and pool start with stub-, tokens are null, and the text starts with [stub] unless the operator supplied a ready answer. If your prompt carries a JSON Schema in the system message, the stub answers with the smallest valid instance.
Modes#
- always: the models are never asked.
- fallback: the stub answers only after the real ladder returned
503. The real attempts stay inattemptsand the stub's rungs are numbered after them.
In always mode, a marker in the last message that has one picks the scenario. An unknown marker is 400, so a typo cannot turn a test green.
| Marker | Scenario | Your product sees |
|---|---|---|
[stub:429] | The first pool is exhausted | An answer with rung: 1 |
[stub:500] | Server error, retried with backoff | rung: 1, tries: 3 |
[stub:slow] | The model times out | rung: 1 after about 4.5 seconds |
[stub:retired] | A counterfeit 200 | rung: 1 |
[stub:rejected] | The request shape is refused | rung: 1 without retries |
[stub:empty] | An empty text | content: null |
[stub:all-fail] | Every rung fails | 503 all_rungs_failed |
[stub:budget] | The models are not asked | 429 budget_exhausted, the counter is not touched |
With tools, the first turn answers with a call to the first declared tool, with arguments built from its schema. A turn that ends with a tool message answers with text.