# All cookbook recipes

Recipes are the "give me code I can paste" shape. Each one is small, self-contained, and runnable. They're organized below by the [workflow stage](/1.-introduction/the-stratix-workflow.md) they map to — **Select**, **Build**, **Observe**, **Evaluate**, **Improve** — plus cross-cutting groupings (industry, integration, migration, SDK basics) at the bottom.

If you're new, start with [Top 5 starter recipes](https://github.com/LayerLens/gitbook-full/blob/main/02-get-started/top-5-starter-recipes.md). Otherwise, browse below.

## Select

Pick the model, benchmark, or prompt before you commit ECU.

* [Pick a model for a task](https://github.com/LayerLens/gitbook-full/blob/main/05-select/cookbook/pick-a-model.md)
* [Compare prompts on a small test set](https://github.com/LayerLens/gitbook-full/blob/main/05-select/cookbook/compare-prompts.md)

## Build

Instrument your code and ship the wiring.

### Framework adapters

* [Instrument a LangChain agent](/6.-build-wire-your-code/instrument-langchain.md)
* [Instrument a LlamaIndex pipeline](/6.-build-wire-your-code/instrument-llamaindex.md)
* [Instrument a Haystack pipeline](/6.-build-wire-your-code/instrument-haystack.md)
* [Instrument an OpenAI Assistants run](/6.-build-wire-your-code/instrument-openai-assistants.md)
* [Instrument a Vercel AI SDK call](/6.-build-wire-your-code/instrument-vercel-ai-sdk.md)
* [Instrument an Anthropic SDK call](/6.-build-wire-your-code/instrument-anthropic-sdk.md)
* [Instrument a custom Python pipeline](/6.-build-wire-your-code/instrument-custom-python.md)
* [OTel-style trace ingestion](/6.-build-wire-your-code/otel-trace-ingestion.md)

### CI / release

* [Containerized CI runner](/6.-build-wire-your-code/containerized-ci.md)
* [Pre-release readiness eval](/6.-build-wire-your-code/prerelease-readiness.md)

## Observe

Capture, route, and warehouse what your system is doing.

* [Backfill from existing logs](/7.-observe-see-whats-happening/backfill-from-logs.md)
* [Post-release continuous eval](/7.-observe-see-whats-happening/postrelease-continuous.md)

## Evaluate

Score what you've captured.

### Score by output shape

* [Score a structured-output prompt](https://github.com/LayerLens/gitbook-full/blob/main/08-evaluate/cookbook/score-structured-output.md)
* [Score a free-form chat prompt](https://github.com/LayerLens/gitbook-full/blob/main/08-evaluate/cookbook/score-chat.md)
* [Score code outputs (HumanEval-style)](https://github.com/LayerLens/gitbook-full/blob/main/08-evaluate/cookbook/score-code.md)
* [Score reasoning chains](https://github.com/LayerLens/gitbook-full/blob/main/08-evaluate/cookbook/score-reasoning.md)
* [Score retrieval quality (precision@k)](https://github.com/LayerLens/gitbook-full/blob/main/08-evaluate/cookbook/score-retrieval.md)
* [Score multilingual outputs](https://github.com/LayerLens/gitbook-full/blob/main/08-evaluate/cookbook/multilingual.md)
* [Validate JSON output with schema](https://github.com/LayerLens/gitbook-full/blob/main/08-evaluate/cookbook/json-schema-validate.md)

### Score by failure mode

* [Catch hallucinations](https://github.com/LayerLens/gitbook-full/blob/main/08-evaluate/cookbook/catch-hallucinations.md)
* [Build a faithfulness judge for RAG](https://github.com/LayerLens/gitbook-full/blob/main/08-evaluate/cookbook/rag-faithfulness-judge.md)
* [Detect tool-call regressions in agents](https://github.com/LayerLens/gitbook-full/blob/main/08-evaluate/cookbook/agent-tool-regressions.md)

### Author your own scorers

* [Custom code grader](https://github.com/LayerLens/gitbook-full/blob/main/08-evaluate/cookbook/custom-code-scorer.md)

### Aggregation and gating

* [Span-level scoring](https://github.com/LayerLens/gitbook-full/blob/main/08-evaluate/cookbook/span-level-scoring.md)
* [Multi-judge consensus](https://github.com/LayerLens/gitbook-full/blob/main/08-evaluate/cookbook/multi-judge-consensus.md)
* [Confidence-weighted aggregation](https://github.com/LayerLens/gitbook-full/blob/main/08-evaluate/cookbook/confidence-weighted-aggregation.md)
* [Cost-aware evaluation](https://github.com/LayerLens/gitbook-full/blob/main/08-evaluate/cookbook/cost-aware-evaluation.md)
* [Run a judge in CI without merging on regression](https://github.com/LayerLens/gitbook-full/blob/main/08-evaluate/cookbook/judge-ci-no-merge.md)

## Improve

Tune what you've scored, drive cost down, keep regressions out.

* [Daily smoke eval](/9.-improve-tune-the-system/daily-smoke-eval.md)
* [Quarterly model re-evaluation](/9.-improve-tune-the-system/quarterly-rebench.md)
* [GEPA basics](/9.-improve-tune-the-system/gepa-basics.md)
* [GEPA with held-out validation set](/9.-improve-tune-the-system/gepa-holdout.md)
* [Iteratively label and re-optimize](/9.-improve-tune-the-system/gepa-iterative-labeling.md)

## Cross-cutting: by industry

* [Healthcare: clinical Q\&A safety judge](https://github.com/LayerLens/gitbook-full/blob/main/04-use-cases/industry/healthcare/cookbook/industry-healthcare-clinical-qa.md)
* [Financial services: advisor chatbot guardrails](https://github.com/LayerLens/gitbook-full/blob/main/04-use-cases/industry/financial-services/cookbook/industry-finserv-advisor.md)
* [Legal: contract review faithfulness](https://github.com/LayerLens/gitbook-full/blob/main/04-use-cases/industry/legal/cookbook/industry-legal-contract.md)
* [Retail: product Q\&A scoring](https://github.com/LayerLens/gitbook-full/blob/main/04-use-cases/industry/retail-ecommerce/cookbook/industry-retail-product-qa.md)
* [Insurance: claims triage scoring](https://github.com/LayerLens/gitbook-full/blob/main/04-use-cases/industry/insurance/cookbook/industry-insurance-claims.md)
* [Education: tutor helpfulness](https://github.com/LayerLens/gitbook-full/blob/main/04-use-cases/industry/education/cookbook/industry-education-tutor.md)

## Cross-cutting: by CI / notification integration

* [GitHub Actions gate](/6.-build-wire-your-code/integration-github-actions.md)
* [GitLab CI gate](/6.-build-wire-your-code/integration-gitlab-ci.md)
* [Buildkite gate](/6.-build-wire-your-code/integration-buildkite.md)
* [Jenkins gate](/6.-build-wire-your-code/integration-jenkins.md)
* [Slack notifications](/6.-build-wire-your-code/integration-slack.md)
* [PagerDuty escalation](/6.-build-wire-your-code/integration-pagerduty.md)

## Cross-cutting: migration from another platform

* [Port a LangSmith eval](https://github.com/LayerLens/gitbook-full/blob/main/06-build/migration/recipes/migration-langsmith.md)
* [Port a Braintrust eval](https://github.com/LayerLens/gitbook-full/blob/main/06-build/migration/recipes/migration-braintrust.md)
* [Port an MLflow run](https://github.com/LayerLens/gitbook-full/blob/main/06-build/migration/recipes/migration-mlflow.md)
* [Port a Promptfoo config](https://github.com/LayerLens/gitbook-full/blob/main/06-build/migration/recipes/migration-promptfoo.md)

## SDK basics

* [Sync vs async clients](https://github.com/LayerLens/gitbook-full/blob/main/13-reference/sdk-python/recipes/sync-async-clients.md)
* [Pagination over large result sets](https://github.com/LayerLens/gitbook-full/blob/main/13-reference/sdk-python/recipes/pagination.md)
* [Retry and backoff](https://github.com/LayerLens/gitbook-full/blob/main/13-reference/sdk-python/recipes/retry-backoff.md)
* [Rate-limit handling](https://github.com/LayerLens/gitbook-full/blob/main/13-reference/sdk-python/recipes/rate-limit-handling.md)

## Where to next

* [Top 5 starter recipes](https://github.com/LayerLens/gitbook-full/blob/main/02-get-started/top-5-starter-recipes.md) — the curated week-one subset
* [All tutorials](/2.-get-started/all-tutorials.md) — guided, end-to-end learning paths
* [All guides](/2.-get-started/all-guides.md) — task-shaped walkthroughs
* [stratix-python samples](https://github.com/layerlens/stratix-python) — many recipes mirror runnable source samples

## Integrate

* [Send results to S3](/10.-integrate-connect-your-stack/integration-s3-export.md)
* [Send results to BigQuery](/10.-integrate-connect-your-stack/integration-bigquery-export.md)
* [Send results to Snowflake](/10.-integrate-connect-your-stack/integration-snowflake-export.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.layerlens.ai/2.-get-started/all-cookbook-recipes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
