Skip to content

feat(examples): add results caching and modernize example runner#53

Merged
richardsolomou merged 3 commits intomainfrom
docs/update-example-runner-for-new-providers
Apr 3, 2026
Merged

feat(examples): add results caching and modernize example runner#53
richardsolomou merged 3 commits intomainfrom
docs/update-example-runner-for-new-providers

Conversation

@richardsolomou
Copy link
Copy Markdown
Member

@richardsolomou richardsolomou commented Apr 2, 2026

Problem

Running 90+ provider examples incurs API costs on every run, even when nothing has changed. The example runner also referenced mprocs (removed), had Makefile targets that duplicated the shell script, and the .env.example only covered 3 providers.

Changes

  • Results caching (run-examples.sh): Cache SHA-256 hashes of example source files in .results/ on success. Subsequent runs skip examples whose source hasn't changed. Works in both sequential (--all) and parallel (--parallel) modes. New flags:
    • --rerun — ignore cache, force re-run (combinable with other flags)
    • --reset — clear the cache
    • --list now shows next to cached examples with a count summary
  • Makefile: Remove all examples-* targets — run-examples.sh is the single entry point
  • .env.example: Add API key placeholders for 14 new providers (Groq, DeepSeek, Mistral, Azure, Bedrock, etc.)
  • Docs (README.md, CLAUDE.md): Update commands to reference ./run-examples.sh directly, mention phrocs
  • uv.lock: Pin litellm to 1.81.13

How did you test this code?

  • bash -n run-examples.sh — no syntax errors
  • ./run-examples.sh --list — discovers all 91 examples, shows cache status
  • ./run-examples.sh --reset — clears cache correctly

Add all new provider API keys to .env.example and update run-examples.sh
to use uv run for Python examples with pyproject.toml instead of the
old requirements.txt-based install.
Cache SHA-256 hashes of example files in .results/ on success. Subsequent
runs skip examples whose source hasn't changed, avoiding unnecessary API
costs across 90+ examples. Use --rerun to force, --reset to clear cache.

Also removes example targets from Makefile (run-examples.sh is the single
entry point), updates docs to reference phrocs, and pins litellm to 1.81.13.

Generated-By: PostHog Code
Task-Id: 81d969ea-b442-458b-a80c-9da48cc3195c
@richardsolomou richardsolomou changed the title docs: update example runner and env for new AI provider examples feat(examples): add results caching and modernize example runner Apr 3, 2026
Batch-compute file hashes in a single shasum call (13s → 0.6s) and
add a PostHog-branded info tab as the first phrocs panel showing
run summary and available commands.

Generated-By: PostHog Code
Task-Id: 81d969ea-b442-458b-a80c-9da48cc3195c
@richardsolomou richardsolomou marked this pull request as ready for review April 3, 2026 13:48
@richardsolomou richardsolomou requested a review from a team April 3, 2026 13:48
@richardsolomou richardsolomou merged commit 2b76934 into main Apr 3, 2026
11 checks passed
@richardsolomou richardsolomou deleted the docs/update-example-runner-for-new-providers branch April 3, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants