Back to Opik

Opik Python SDK Design Documentation

sdks/python/design/README.md

2.0.22-6605-merge-20651.9 KB
Original Source

Opik Python SDK Design Documentation

Comprehensive architecture documentation for contributors and team members. These guides explain how the SDK works internally, not how to use it.

📚 Documentation

DocumentPriorityDescription
API and Data Flow⭐ Start HereCore architecture, 3 layers, sync vs async operations, batching, message processing
Testing🔵 EssentialTest categories, fake backend, TraceModel/SpanModel patterns
Integrations🟣 As NeededIntegration patterns (method patching, callback, hybrid), streaming strategies
Evaluation🟣 As NeededEvaluation engine, all 4 evaluation methods, metrics architecture

🚀 Quick Start

First-Time Contributors

  1. Read API and Data Flow - Understand core architecture
  2. Read Testing - Learn testing patterns
  3. Choose domain doc based on your task

By Task

TaskDocumentKey Sections
Understanding @opik.trackAPI and Data FlowDecorator Data Flow, Context Management
Adding integrationIntegrationsIntegration Patterns, existing integrations
Creating metric, evaluation pipelinesEvaluationMetrics Architecture
Debugging performanceAPI and Data FlowBatching System, Performance
Writing testsTestingTesting Patterns, fake backend

🔄 Maintenance

Update documentation when:

  • Major architectural changes
  • New patterns introduced
  • New integrations added
  • Performance optimizations

Quality standards:

  • Accurate (reflects codebase)
  • Clear (easy for newcomers)
  • Practical (real examples)

Last Updated: 2025-01-20

Questions? Open an issue or contact the SDK team.