Skip to content

Add comprehensive documentation and guides for Cycles#36

Merged
amavashev merged 2 commits intomainfrom
claude/review-docs-gaps-TJqV6
Mar 15, 2026
Merged

Add comprehensive documentation and guides for Cycles#36
amavashev merged 2 commits intomainfrom
claude/review-docs-gaps-TJqV6

Conversation

@amavashev
Copy link
Contributor

Summary

This PR adds extensive documentation and guides for the Cycles budget governance system, including quickstart tutorials, operational guides, integration patterns, and incident postmortems. The documentation covers deployment, configuration, integration with various LLM providers, and production best practices.

Key Changes

New Quickstart Guides:

  • quickstart/what-is-cycles.md - Introduction to Cycles concepts and the reserve-commit lifecycle
  • quickstart/end-to-end-tutorial.md - Complete 10-minute tutorial from zero to a working budget-guarded LLM call, including Docker Compose setup, tenant creation, budget funding, and sample applications in Python and TypeScript

Operational & Production Guides:

  • how-to/production-operations-guide.md - Redis configuration, persistence, HA setup, Cycles Server configuration, network architecture, and monitoring
  • how-to/monitoring-and-alerting.md - Key metrics (budget utilization, reservation lifecycle, server health), alerting thresholds, and observability patterns
  • how-to/security-hardening.md - Network isolation, Redis security, API key management, least-privilege permissions, and audit logging

Integration Guides:

  • how-to/integrating-cycles-with-express.md - Middleware and inline patterns for Express.js applications
  • how-to/integrating-cycles-with-vercel-ai-sdk.md - Integration with Vercel AI SDK for Next.js streaming applications
  • how-to/integrating-cycles-with-aws-bedrock.md - Non-streaming and streaming patterns for AWS Bedrock
  • how-to/integrating-cycles-with-google-gemini.md - Integration with Google Gemini API

Practical How-To Guides:

  • how-to/choosing-the-right-integration-pattern.md - Decision tree and comparison of decorator, streaming adapter, middleware, and programmatic client patterns
  • how-to/cost-estimation-cheat-sheet.md - USD_MICROCENTS unit explanation, provider pricing reference tables, and quick estimation formulas
  • how-to/common-budget-patterns.md - Recipes for per-user daily budgets, per-conversation budgets, model-tier budgets, and team-level rollup budgets
  • how-to/adding-cycles-to-an-existing-application.md - Incremental adoption path with shadow mode, wrapping individual calls, and expanding coverage
  • how-to/troubleshooting-and-faq.md - Common issues (budget exceeded, TTL expiry, idempotency mismatches) with solutions

Incident Postmortems:

  • incidents/scope-misconfiguration-and-budget-leaks.md - Failure mode from inconsistent scope configuration
  • incidents/retry-storms-and-idempotency-failures.md - Unbounded retry loops causing overspend
  • incidents/concurrent-agent-overspend.md - Race conditions with concurrent agents sharing budgets

Reference:

  • changelog.md - Release history and protocol specification summary for v0.1.23

Documentation Site Updates:

  • Updated .vitepress/config.ts to reorganize navigation and add new guide sections
  • Updated index.md homepage with improved tagline and call-to-action

Notable Implementation Details

  • Documentation uses consistent code examples across Python, TypeScript, and Java SDKs
  • Pricing tables include current rates for OpenAI, Anthropic, and Google models with microcent conversions
  • Guides include complete, runnable examples (Docker Compose configs, curl commands, application code)
  • Troubleshooting guide covers the most common integration issues with step-by-step fixes
  • Incident postmortems provide real-world failure scenarios and prevention strategies
  • Navigation structure organizes content into Quickstart, How-To, and Reference sections

https://claude.ai/code/session_016sFHtxX3RSCvHyu7eV4nuH

claude added 2 commits March 15, 2026 20:43
…tegration, and operations

Tier 1 (Adoption):
- What is Cycles? overview page with code examples
- End-to-end tutorial (zero to budget-guarded LLM call)
- Cost estimation cheat sheet with provider pricing tables
- Troubleshooting and FAQ
- Integration guides: Vercel AI SDK, Express, AWS Bedrock, Google Gemini

Tier 2 (Developer Experience):
- Migration guide for existing applications
- SDK pattern selection guide (decorator vs programmatic vs streaming)
- Common budget patterns (per-user, per-conversation, model-tier, team rollups)
- 3 new incident patterns: retry storms, concurrent overspend, scope misconfiguration

Tier 3 (Operations):
- Production operations guide (Redis HA, scaling, upgrades, runbooks)
- Monitoring and alerting guide (metrics, Prometheus rules, dashboards)
- Security hardening guide (network isolation, Redis AUTH, key rotation)
- Changelog page

Also updates:
- Landing page with improved hero, tagline, and navigation
- VitePress sidebar with new Integrations and Operations sections
- Nav bar quickstart link points to new overview page

https://claude.ai/code/session_016sFHtxX3RSCvHyu7eV4nuH
- Fix migration guide: dry_run=True on @cycles decorator skips function
  execution (returns DryRunResult), not shadow observation. Replace with
  correct pattern using the decide endpoint for non-blocking observation.
- Fix troubleshooting: remove incorrect async_cycles import. Python @cycles
  decorator auto-detects sync/async functions. Add AsyncCyclesClient note.

https://claude.ai/code/session_016sFHtxX3RSCvHyu7eV4nuH
@amavashev amavashev merged commit b79ca81 into main Mar 15, 2026
1 check passed
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