Giraffe is a test suite for engineers running self-hosted LLMs. Point it at an existing OpenAI-compatible chat API, such as Ollama or vLLM, to check answers against expected results, measure response times, and test behavior under load. Run it from the command line or a local web UI, inspect failed requests, and compare results before and after a deployment change.
Use it to answer questions like:
- Do answers that pass individually still pass when requests run concurrently?
- Which tested traffic rates meet our correctness and response-time limits?
- After a server upgrade, which checks or measurements got worse?
Start with built-in checks, or supply your own questions and expected answers. You choose the checks, traffic and acceptance limits. A passing run applies to those tests and settings; it does not establish general model quality or certify production capacity.
Quick start · Inference engines · Conversations · Baselines · Tests · Docs · Discord
Start your inference server separately and have a model ready to use.
Install giraffe-llm from PyPI in a virtual environment. The command is giraffe:
Giraffe runs on macOS and Linux with Python 3.11 or newer. Windows is not supported.
python3 -m venv .venv
source .venv/bin/activate
python -m pip install "giraffe-llm==0.1.0a2"This example uses Ollama with a model already installed. Replace the URL for your server.
giraffe run --url http://127.0.0.1:11434/v1 --htmlThe model is auto-detected when only one is served; otherwise add --model MODEL_ID.
The CLI and UI select the same four checks by default:
access, serving, correctness, first_output. These check endpoint access, response
validity, answer correctness and p95 time to the first answer.
The default first-output limit is 10,000 ms, a generous laptop sanity bound;
override it with --first-output-ms or YAML limits.first_output_ms.
Default check concurrency is four. Fully scored answers can conclude on accuracy when
concurrency is inherited; missing server overlap is reported as an observation.
Set --default-concurrency or a per-check concurrency override above one to require concurrent evidence.
The 10,000 ms sanity bound applies only to first_output.
Outputs: results in the terminal, plus JSON and HTML reports in runs/<timestamp>/. The command exits when finished. Open report.html to inspect each check and its requests.
A pass means the selected required checks have enough evidence and meet their limits. A fail means a check observed a failure. Inconclusive means there is not enough evidence to decide; blocked means the run or check could not proceed. See the results guide for exit codes and partial runs.
Run this in your terminal:
giraffe uiOpen the access link printed in the terminal (it contains a per-launch token), enter your endpoint and model, choose checks, then Launch. Keep the terminal open; Ctrl+C stops the UI. Use --port to choose a different port.
Connect through the engine’s OpenAI-compatible chat API. Discovery, metrics and server-side evidence vary by engine.
Generate a starter configuration from your installed package:
giraffe init --engine vllm --url http://127.0.0.1:8000/v1
giraffe validate --config giraffe.yaml
giraffe run --config giraffe.yaml --htmlinit discovers the model when exactly one is served; otherwise edit the model
placeholder. It refuses to overwrite giraffe.yaml without --force.
Supported engines are ollama, vllm, sglang, llamacpp, tgi, lmdeploy
and tensorrt-llm. The repository also has detailed examples:
| Engine | YAML configuration |
|---|---|
| Ollama | local.yaml |
| vLLM / vLLM-Metal | vllm.yaml |
| SGLang | sglang.yaml |
| llama.cpp server | llamacpp.yaml |
| TensorRT-LLM | tensorrt-llm.yaml |
| LMDeploy | lmdeploy.yaml |
| Hugging Face TGI | tgi.yaml |
Edit the generated giraffe.yaml for your endpoint, model, checks and limits:
giraffe run --config giraffe.yaml \
--output runs/before --htmlGiraffe reads the run settings from YAML; --output chooses where to save the results, and --html adds an HTML report.
Reasoning models: set options such as reasoning_effort and
chat_template_kwargs under YAML request_options; see
examples/reasoning.yaml.
Measuring generation pace: Giraffe needs token counts at streamed answer
boundaries, not just a final token total. When your server streams logprobs, as
Ollama does, Giraffe detects this and uses them automatically. Otherwise, on a
compatible server such as vLLM, enable
request_options.stream_options.include_usage: true and
request_options.stream_options.continuous_usage_stats: true. Without either,
generation pace remains unmeasured and a required minimum rate stays inconclusive;
first-answer time, stream pauses and total response time still work. See
streaming generation pace.
Use --quiet --junit junit.xml --summary-md summary.md for CI output. Saved
runs support giraffe report runs/before --junit junit.xml --summary-md summary.md.
--fail-on inconclusive is the default; --fail-on fail accepts an inconclusive
verdict with a stderr note. --fail-on never accepts failed and inconclusive
verdicts, including baseline regressions, with a stderr note. Blocked runs and
errors keep their exit codes.
The composite Action installs the selected package release, adds a job summary and uploads run artifacts, including when checks fail. Choose a package version containing these CLI options:
steps:
- uses: actions/checkout@v4
- uses: 0dust/giraffe@main
with:
url: http://127.0.0.1:8000/v1
model: your-model
checks: access,serving,correctness,first_output
fail-on: inconclusive
python-version: '3.12'
version: latestrun --help shows common options; run --help-all includes advanced settings.
Manage saved runs with giraffe runs list, runs cleanup and runs keep.
The default install includes the CLI, UI and built-in tiktoken sizing with bundled
encoding data; built-in sizing needs no internet or writable cache. To use a
model's Hugging Face tokenizer, install giraffe-llm[hf-tokenizer].
For Docker, build with docker build -t giraffe ., then run:
docker run --rm -p 127.0.0.1:8765:8765 giraffe ui --host 0.0.0.0Open the printed token link (wildcard binds use localhost in the link). The
published port is accessible only from the Docker host. To expose it beyond
localhost, change the published address deliberately and use a trusted network.
Keep the access link private; it permits run control and access to saved reports.
Select Load test to repeat requests at different concurrency levels or arrival rates. Set the traffic and correctness, response-time and error limits for your service, then inspect which tested settings pass and which fail. The highest passing setting is a tested result, not a discovered maximum capacity.
Built-in workloads cover different input and output lengths. You can also supply your own questions and expected answers to test the work your application needs. See the Load test guide for traffic patterns, answer checks and configuration examples.
Select Concurrent conversations in the UI to test recall or conversation performance. Choose fixed or dynamic pauses; performance runs can also vary new-message token lengths, output caps and turns per conversation with a reproducible seed.
To run the same settings from the CLI, choose Copy terminal command in the UI, or Save setup and run the downloaded file:
giraffe run --config giraffe-config.json --htmlRun this from the folder containing the downloaded file, or pass its full path.
For a YAML starting point, download session-distributions.yaml
from GitHub, update its endpoint and model, then run
giraffe run --config session-distributions.yaml --html from that folder.
Repository examples are not installed into your working directory by pip.
See conversation settings for
weights, seeds and token-length limits.
Save the completed runs/before run as a reference. After a deployment change,
such as a server upgrade, run the same configuration with --baseline. Keep the
endpoint URL, model ID, workload and acceptance settings the same across runs:
giraffe baseline save runs/before baselines/before.json
# After changing your deployment:
giraffe run --config giraffe.yaml \
--baseline baselines/before.json --output runs/after --htmlThe new report shows acceptance results and changes against the saved baseline. Keep the workload comparable; incompatible measurements stay inconclusive.
In the UI, open a completed run and choose Save baseline (fully passing runs) or Save as reference baseline (other completed runs). Name and save it, then choose Compare a new run with this baseline at the bottom of the report, or Compare a new run when shown at the top. Baseline guide →
The four defaults are access, serving, correctness, first_output; select additional checks for your endpoint.
| Check · CLI ID | What it checks |
|---|---|
Endpoint response · access |
Connection, authentication and ordinary inference |
Response validity · serving |
Complete, valid, nonempty responses |
First answer · first_output |
Time to the first useful answer |
Generation · generation |
Answer rate, response time and stream pauses |
Load test · load |
Correctness and timing under selected traffic patterns |
Context recall · context |
Recall of known facts across long inputs |
Answer correctness · correctness |
Answers against expected values |
JSON correctness · json |
Expected fields, types and values |
Cancellation & timeouts · cancellation |
Caps, stop behavior, client cancellation and follow-up requests |
Recovery after load · recovery |
Heavy traffic followed by matched light probes |
Scale-down continuity · scale_down |
Active responses, backend draining and survivor capacity during one external replica removal |
GPU metrics · gpu |
Available GPU telemetry |
Prompt cache evidence · prefix |
Reported cache reuse against independent controls |
Concurrent conversations · sessions |
Recall and timing across concurrent conversations |
Multi-user · multi_user |
Persistent users sharing request slots, with individual delivery and timing outcomes |
Gateway quotas & priorities · gateway_policy |
Opt-in LiteLLM policy observations with separate identities, bounded traffic and continued peer service |
Gateway usage attribution · gateway_attribution |
Marked requests and final token counts matched to existing LiteLLM spend logs |
Gateway access policy · gateway_access |
Declared allow/deny cases using existing test identity references |
Answer consistency · consistency |
Answer agreement across repeated requests |
Tool-call correctness · tools |
Tool-call structure, names and expected arguments |
The catalog includes verdict checks and two server observations: GPU metrics and Prompt cache evidence. Both remain in the selected checks and baseline configuration. Missing GPU telemetry and missing or inactive prefix caching do not change the verdict. GPU hardware faults and an exceeded configured temperature limit can still fail the run. Prompt cache evidence never fails the run.
Gateway access is an optional LiteLLM check with explicit expected allow and deny cases. Configure it in the UI or run the example after supplying existing test identity environment references. Network failures and unsupported error formats remain unverified; no keys or privileges change. See the access-policy guide for supported evidence and limits.
Gateway attribution is optional and independent of simulated users. The bounded
LiteLLM example sends four requests using two
existing virtual keys and reads /spend/logs/v2; run it with
giraffe run --config examples/litellm-attribution.yaml after setting the three
named environment variables and the served model. It needs an existing LiteLLM
database with spend logging and an observer credential authorized to read both
identities. Giraffe makes only GET requests to the evidence endpoint and does not
create keys, change gateway settings, or reset counters. LiteLLM's available
reader permissions depend on the deployment; a supplied admin credential remains
privileged even though this check only reads.
targets[].test_identities contains labels and api_key_env/headers_env
references. A selected probe identity replaces all target authentication and
custom headers and ignores ambient cookies; {} explicitly means anonymous.
Missing references never fall back to the shared key. Identity probes retain
numeric response evidence, not answer text or arbitrary server identifiers.
Ordinary requests continue to use the target's shared credentials.
On marked probes, Giraffe reserves the x-litellm-trace-id, x-litellm-session-id, and
x-litellm-spend-logs-metadata headers and the litellm_session_id body field for
generated correlation markers.
The LiteLLM reader sends a bounded UTC date window covering the probes and
settle period on every page. The adapter requires generated request metadata, the matching session
marker, a gateway API-key hash, and complete final prompt/completion token counts.
Each alias must use a distinct virtual key. The adapter recognizes Bearer authorization
and LiteLLM's x-litellm-api-key header, and compares key hashes only in memory.
Repeated log rows count once. The final read is scheduled at 85% of
settle_seconds to leave time for the request within the collection limit. It must complete
within the run budget before evidence qualifies. For streamed requests, usage
must arrive with or after the finish event. Missing rows, log lag beyond the
bounded wait, changed or ambiguous rows, capped or inconsistent pagination, and
missing final token usage leave the result unverified. The adapter uses
marked spend-log rows, so shared counter resets cannot produce a pass. Results separately name
not selected, unavailable, unsupported, unverified, and observed
mismatch; a verified result covers only the marked requests observed.
Unconfigured or unsupported attribution remains visible and optional in mixed runs.
Shared-key workloads, including Recovery, finish on all targets before attribution. Attribution uses
the remaining request budget. In a request-capped mixed run, Giraffe checks the
reader's status with a bounded GET before sending identity probes.
Exports retain the reader settings and identity references. Changes to the reader,
check settings, or participating references affect attribution comparisons only.
References alone cannot establish that the underlying credential values stayed the same.
The adapter follows LiteLLM's documented spend-log API and request headers. Controlled fixtures test that contract; a successful run against your actual gateway is needed to establish deployment compatibility and attribution.
When selected, generation uses a 5,000 ms stream-gap limit if no generation
limit is supplied; this catches stalls without imposing a token speed. Set
--stream-gap-ms or YAML limits.stream_gap_ms to override it; an explicit YAML
stream_gap_ms: null disables this fallback. Recovery can pass
on correctness and error rate without a timing limit; timing remains an observation.
Use --json (an alias of --output-format json) for machine-readable CLI output.
Use --structured-output to add the structured-JSON check, and --verbose to show
diagnostic stages and RAM measurements. JSON reports retain those measurements.
Results are pass, fail, inconclusive, skipped or blocked. Missing delivery or measurement evidence stays inconclusive. Inspect the request evidence before attributing a failure to your inference server.
Documentation index — detailed guides in the same repository:
Running & baselines · Workloads & measurements · Offline & Docker · Resource limits
Join the Giraffe Discord to get help with runs and reports, share feedback, and discuss ideas. Start a post in #help-and-feedback for a question, bug, or suggestion, and follow #updates for releases and improvements.
Report an issue with your Giraffe version, engine/model and reproduction steps. Remove API keys and private prompts or answers before sharing reports.
Contributing · Apache 2.0 license
The opt-in scale_down check keeps streamed answers active while you remove one
replica externally, then reports client-visible continuity, backend drain
semantics and remaining capacity separately. Start with
examples/scale-down.yaml and the
operator workflow.
A read-only lifecycle exporter and a representative long-answer fixture are
needed for complete coverage. Missing evidence stays inconclusive; successful
traffic alone does not establish graceful draining. Giraffe does not provision or
remove replicas. Controlled HTTP tests are available; qualification on a real
multi-replica deployment is still pending.