Weflayr captures every LLM call and joins cost to revenue, so you know which customers make you money and which ones cost you.
See the margin gain from cheaper models and prompt-caching mechanisms, and act on it for the customers draining your margins.
Observability is the way in. Optimization is the product.
One line of code captures every LLM call and joins cost to revenue. Live P&L per customer and feature.
Get told when a feature cost climbs or a customer turns loss-making. Before the bill lands.
Cheaper models that hold quality or prompt caching optimization. Measured on your real traffic, with the margin gain measured before you ship.
Enforce the recommendations.
Weflayr's unique prompt caching optimisation engine indexes every prompt your project sent and finds the blocks that repeat, across calls, across features, across customers. It searches the optimal caching configuration your provider actually supports, restructures the prompt when the stable content sits in the wrong place, and validates each candidate on traffic it was not derived from.
The features Support Chat and Auto-Summarize both open with a run_context header, and both re-inject a per-workspace activity block between the instructions and the worked examples. Two volatile blocks therefore sit inside the 5,560 tokens the two features send byte-identical, so the cache breaks at the first of them and nothing below is ever reused. Hoisting the instructions, the worked examples and the output format into one contiguous region, with both volatile blocks below them, lets the two features read a single cache entry instead of paying twice for the same tokens.
The moved blocks reference nothing in the run header or the activity block, so both orderings read identically to the model. No wording changes.
The breakpoint sits after the first user turn today, so the cached region includes content that changes on every call and the entry is rewritten instead of read. Placing it at the end of the worked examples caches only the stable region. Support Chat's calls also arrive further apart than five minutes, so the hour TTL earns back its higher write price.
Breakpoint placement and TTL are caching config. The prompt text and its order are untouched.
Weflayr replays your real production runs on candidate models and judges each output against the one you actually shipped. You get the quality delta and the cost delta before you switch a single token.
Point your calls at Weflayr's gateway and the recommendations you accepted apply themselves on every request: the cheaper model where quality holds, the prompt order that hits the cache, the right path for each customer's margin.
Weflayr tracks all your LLM calls with one line of code. Then tag each call with the customer and the feature, and cost lands in your dashboard joined to revenue.
Read the technical docsimport weflayr # one line: instrument your provider SDK, call sites unchanged weflayr.auto_instrument(ai_sdks=weflayr.AiSdk.OPENAI) # tag each call with who it is for and why with weflayr.propagate_metadata( feature_name="support-chat", customer_id="c_123" ): client.chat.completions.create( model="gpt-5.5", messages=[{"role": "user", "content": prompt}], )