You are setting up Evigauge — an observability, evaluation and
cost-control platform for LLM applications — in this repository.
Work through the phases in order. Phase 1 is done by a human in a browser;
stop and ask for its outputs before writing any code. Everything from Phase 3
on is yours.
Read the documentation before you write code. Every page is available as raw
markdown by replacing /docs/ with /docs/md/ and adding .md — for example
https://www.evigauge.com/docs/md/sdk/python-sdk.md. Fetch the pages relevant
to the phase you are on. Do not infer an API from a page title; read the page.
If you can fetch only one thing, fetch https://www.evigauge.com/llms-full.txt
— the entire documentation as a single file.
================================================================
PHASE 1 — ACCOUNT SETUP (human, in the browser; ask for the results)
================================================================
Tell the developer to do this and report back. Do not guess these values.
1. Sign up at https://www.evigauge.com and verify the email address.
2. Create a WORKSPACE. A workspace is the tenancy boundary: members,
billing and settings live on it.
3. Create a PROJECT inside that workspace, from the workspace switcher at
the top of the sidebar → "Manage projects", or Settings → Projects.
A project is what every trace, cost figure and check is filed under.
The project SLUG (lowercase, hyphenated) is immutable and is what the
code sends as project_id. The display name is not.
4. TURN ON PROMPT & RESPONSE CAPTURE. Settings → System settings →
"Prompt & response capture", and switch it on.
This matters more than anything else on this list. It is OFF by default.
While it is off, ingest strips prompt and response bodies, so traces
arrive with cost and latency but no text — and every feature that reads
the text (ShipCheck's prompt scoring, decomposition, drift) has nothing
to work with. Redaction runs before storage either way.
5. COPY THE SDK CREDENTIALS. Settings → API → "evigauge-trace SDK config".
Press "Copy all" — it yields a complete .env block:
EVIGAUGE_ORG_ID=...
EVIGAUGE_WORKSPACE_ID=...
EVIGAUGE_INGEST_URL=https://ingest.evigauge.ai
EVIGAUGE_PROJECT_ID=<the project slug from step 3>
6. CREATE TWO API KEYS, on the same Settings → API page:
- one with environment TEST
- one with environment LIVE
Scope BOTH to the project from step 3 rather than to the whole
workspace, so a leaked key cannot read another project's traces.
The secret is shown once, at creation. Copy it then.
7. COPY THE PROJECT'S SEND-DATA DETAILS. Settings → Projects → the
"How to send data here" link under the project name. It reveals the
exact SDK line, OTLP header and Claude Code variable for that project,
with its id already filled in. Paste that into this chat.
Ask the developer for: the .env block from step 5, both API keys from
step 6, and the snippet from step 7. Wait for them before continuing.
================================================================
PHASE 2 — CLAUDE CODE PLUGIN (optional, do it if using Claude Code)
================================================================
In Claude Code, run:
/plugin marketplace add evigauge-org/evigauge-cli-plugin
/plugin install evigauge@evigauge
It brings the bundled pxcore MCP server, so no pip install is needed.
Reference: https://www.evigauge.com/docs/mcp/part-2-the-claude-code-plugin
================================================================
PHASE 3 — WRITE THE .env
================================================================
Create or extend .env with the values from Phase 1:
EVIGAUGE_ORG_ID=<from step 5>
EVIGAUGE_WORKSPACE_ID=<from step 5>
EVIGAUGE_PROJECT_ID=<the project slug>
EVIGAUGE_INGEST_URL=https://ingest.evigauge.ai
EVIGAUGE_API_KEY=<the LIVE key from step 6>
EVIGAUGE_API_KEY_TEST=<the TEST key from step 6>
EVIGAUGE_TRANSPORT=direct
Add .env to .gitignore if it is not already there, and commit a
.env.example carrying the keys with empty values.
================================================================
PHASE 4 — CHOOSE AN INTEGRATION PATH
================================================================
There are two, and they are not alternatives so much as different depths.
Decide by reading both pages, then tell the developer which you chose and
why.
A. THE AI GATEWAY — one line, no code change beyond it.
https://www.evigauge.com/docs/gateway
Point the existing OpenAI-compatible client at the gateway:
base_url = "https://gateway.evigauge.ai/v1"
Authorization: Bearer <EVIGAUGE_API_KEY>
Every call through it is captured with cost, tokens and latency. Choose
this when the application is mostly direct provider calls and you want
coverage today. It sees requests and responses; it cannot see the agent
structure around them.
B. THE SDK — the one that produces reconstruction.
https://www.evigauge.com/docs/sdk
https://www.evigauge.com/docs/sdk/python-sdk
https://www.evigauge.com/docs/sdk/typescript-javascript
https://www.evigauge.com/docs/sdk/framework-adapters
https://www.evigauge.com/docs/sdk/configuration-reference
Instrument the agent so Evigauge can reconstruct WHY it acted. This is
what feeds decomposition, decision graphs and provenance, none of which
the gateway alone can produce, because they are about structure the
gateway never sees.
Check framework-adapters first — if this codebase uses LangChain,
LlamaIndex, CrewAI or similar, the adapter is less work and more
accurate than hand-instrumenting.
Running both is normal and supported: the gateway for breadth over every
call, the SDK for depth on the agent paths that matter.
================================================================
PHASE 5 — SEND THE DATA THAT MAKES THE FEATURES WORK
================================================================
Each of these is a real surface in the product, and each is dark until the
corresponding data arrives. Read the page before implementing it.
COST AND TOKENS — the single most common thing to get wrong
https://www.evigauge.com/docs/api/usage-latency-cost
https://www.evigauge.com/docs/sdk/python-sdk
Cost does not arrive with the span. It is COMPUTED SERVER-SIDE from what
record_cost() reports, so a span without that call shows a blank cost in
the dashboard no matter how much it actually cost. Call it on EVERY LLM
span:
record_cost(
model="claude-opus-4-6", # exact provider identifier
input_tokens=usage.input_tokens,
output_tokens=usage.output_tokens,
reasoning_tokens=..., # extended thinking, if any
tool_call_count=...,
injected_context_tokens=...,
used_context_tokens=...,
)
Rules that decide whether cost appears at all:
- model must be the exact provider identifier the pricing table knows
("claude-opus-4-6", "gpt-4o-mini"). A display name, an internal alias
or a shortened string will not price.
- Read the real usage object the provider returns. Never estimate token
counts, and never reuse a count from a previous call.
- reasoning_tokens are BILLED and usually invisible. Folded into
output_tokens or omitted, a reasoning model looks cheap and is not.
- injected_context_tokens vs used_context_tokens is what powers the
context-optimization recommendations. Sending only one of them, or
setting both equal when they are not, makes that surface useless.
estimate_cost_usd() exists for local pre-flight estimates only. Stored
cost is computed independently, so do not send your own figure.
SPAN TAGS — reasoning_role AND node_type (why tags go missing)
https://www.evigauge.com/docs/sdk/python-sdk
These two drive the tags shown on a span, and BOTH ARE SERVER-VALIDATED
ENUMS. A value outside the list does not degrade to untagged — the span
FAILS VALIDATION AND IS DEAD-LETTERED. It never reaches the dashboard.
That is the usual reason a developer sees neither tags nor cost for work
they are certain they instrumented.
reasoning_role — what the step is FOR. Exactly one of:
decomposer · research · analysis · critique · synthesis ·
arbiter · retrieval · guardrail · post_process
node_type — what kind of component it is. Exactly one of:
decomposer · classifier · agent · guardrail · post_process · retrieval
Note what is NOT in either list: "generation", "llm", "completion",
"tool", "embedding". These are the obvious guesses and every one of them
kills the span. If no listed value fits, OMIT the field — an untagged
span is kept, an invalidly tagged one is thrown away.
Two further schema rules with the same consequence:
- Only documented evigauge.* keys exist; the schema is extra="forbid",
so any invented evigauge.* key kills the span.
- Keys are FLAT: evigauge.prompt_id, never evigauge.prompt.id.
After implementing, re-read the enumerations page and check every literal
you wrote against it, character for character.
RETRIEVAL AND SOURCE TAGS
Retrieval spans carry consulted / used / dropped as string[] of URLs or
stable IDs — never {id, title} objects, which kill the span. The
consulted-vs-used split is what surfaces "retrieved a good source and
ignored it"; sending only used= loses that entirely.
PROMPT TEXT AND THE CACHEABLE PREFIX
On an LLM span, query_text IS the prompt — it is what Evigauge versions,
scores in ShipCheck, and measures the cacheable prefix from. Render
messages with role boundaries intact:
query_text = "
".join(f"{m['role']}:
{m['content']}" for m in messages)
Joining with a space instead destroys the boundary, so every call hashes
as its own distinct prompt and the Prompts page fills with thousands of
one-call rows while the stable prefix reads "Not measured".
Engines take the FIRST non-empty query_text and the LAST non-empty
outcome_text in a trace: put the query on the earliest span and the
outcome on the latest. Both are plain strings — never json.dumps them.
SPANS AND TRACES
https://www.evigauge.com/docs/api/traces-reconstruction
https://www.evigauge.com/docs/api/ingest-api-otlp
One trace per user-facing request; one span per model call, tool call or
retrieval. Parent every span correctly — the parent/child relationship IS
the reconstruction, and a flat list of spans produces a flat, useless
graph.
DECOMPOSITION, DECISION GRAPHS, PROVENANCE, RELIABILITY
https://www.evigauge.com/docs/api/traces-reconstruction
These read the structure and the captured text. They need: correct span
parenting, tool calls recorded as spans with their arguments and results,
retrieval sources attached to the spans that used them, and Prompt &
response capture ON (Phase 1, step 4). With capture off they render empty
and look broken.
FLEET MONITORING
https://www.evigauge.com/docs/api/fleet-monitor
https://www.evigauge.com/docs/connectors
Agents across hosts, vendors and clouds in one view. For AWS Bedrock or
Kubernetes pipelines, the cloud connectors are agentless and need no code
change: https://www.evigauge.com/docs/connectors/kubernetes
SHIPCHECK (prompt versions scored in CI)
https://www.evigauge.com/docs/api/ship-check
Scores every prompt version against the calls it actually made. Needs
capture on, since it reads the prompt text.
EVAL
https://www.evigauge.com/docs/api/eval
Datasets, runs and judges.
DRIFT AND ALIGNMENT
https://www.evigauge.com/docs/api/sources-drift
https://www.evigauge.com/docs/api/alignment
================================================================
PHASE 6 — VERIFY, AND DO NOT SKIP THIS
================================================================
1. Run the application so it makes at least one real model call.
2. Open Observability in the console and confirm the trace arrived under
the right project — NOT under Default.
3. Open one trace and confirm: cost is non-zero, token counts are present,
the span tree has depth rather than being flat, and prompt text is
visible (if it is missing, Phase 1 step 4 was skipped).
4. Open ShipCheck and confirm the prompt version is listed.
A span naming a project that does not exist is NOT rejected — it is filed
under the workspace's default project and flagged. If traces land in
Default, the project_id does not match the slug; fix the value rather than
creating a second project.
================================================================
REFERENCE
================================================================
Full documentation index: https://www.evigauge.com/docs
Whole docs as one file: https://www.evigauge.com/llms-full.txt
Page index for agents: https://www.evigauge.com/llms.txt
Any page as markdown: https://www.evigauge.com/docs/md/<path>.md
REST API reference: https://www.evigauge.com/docs/api
Authentication and keys: https://www.evigauge.com/docs/api/api-keys
OTLP ingest: https://www.evigauge.com/docs/api/ingest-api-otlp
The evigauge CLI: https://www.evigauge.com/docs/sdk/the-evigauge-cli
MCP server: https://www.evigauge.com/docs/mcp/part-1-the-pxcore-mcp-server
Begin with Phase 1: tell the developer exactly what to do in the browser,
and wait for the values before writing any code.