Skip to content

🙀 L0-Python 0.18.0 - Full Pydantic Model Suite

Choose a tag to compare

@LZL0 LZL0 released this 10 Dec 14:07
b5b77f1

This release delivers a complete Pydantic model export layer for every major L0 type.


✨ New: Full Pydantic Model Suite (l0.pydantic)

L0 now provides a complete Pydantic BaseModel mirror of every major internal dataclass.

You can now import Pydantic equivalents for:

  • Core types (StateModel, RetryModel, TimeoutModel, TelemetryModel, etc.)
  • Consensus models
  • Drift detection
  • Guardrails
  • Metrics snapshots
  • Parallel/race operations
  • Pipeline execution
  • Pool operations
  • Event sourcing + replay
  • Observability events
  • Windowing/document chunking

Example:

from l0.pydantic import StateModel, RetryModel, DriftResultModel

state = StateModel(content="hello", token_count=5)
json_data = state.model_dump_json()
schema = StateModel.model_json_schema()

This enables:

  • Typed JSON schemas for OpenAPI/SDKs
  • Runtime-safe structured logging
  • Interop with FastAPI / Litestar
  • Persisting structured observability events
  • Easier debugging & replay

📦 The new module contains over 1,500 lines of typed models, covering all L0 dataclasses.


📈 Benchmark Improvements

BENCHMARKS.md received several updates:

  • Updated environment to Python 3.13, pytest 9, and pytest-asyncio 1.3.0
  • Clarified methodology
  • Updated Nvidia Blackwell section
  • Added Python 3.14 performance note:
    Pydantic import overhead currently impacts async iteration speed by ~30% in Python 3.14; this appears to be a Pydantic compatibility issue, not a Python regression
  • Updated instructions for running benchmarks (now explicitly using Python 3.13)

🧩 Summary of Changes

Area Change
Pydantic Export Layer Full Pydantic BaseModel suite for all L0 types
README New Pydantic section + improvements
Benchmarks Updated environment, performance notes, 3.14 caveats, commands
Events Updated/expanded Pydantic event definitions
Testing New comprehensive Pydantic model tests

🎯 Why This Matters

This release lays the foundation for:

  • Strong typing across every L0 subsystem
  • First-class OpenAPI / schema-driven integrations
  • Richer tooling: dashboards, telemetry pipelines, logging processors
  • Fully typed observability + replay pipelines
  • Easier internal and external adapter development

L0 now provides one of the most complete type-model sets in the Python AI ecosystem.