Skip to main content

Crate plato_room_context

Crate plato_room_context 

Source
Expand description

§plato-room-context

Context window manager for PLATO rooms. Token budgets, eviction policies, priority stacking, and sliding window management.

§Why Rust

Context management is called on every message in every room. It must be:

  • Fast: <0.1ms per context update
  • Predictable: no GC pauses mid-conversation
  • Memory-efficient: thousands of concurrent rooms
MetricPython (dict + deque)Rust (VecDeque + struct)
Update 1000 contexts~8ms~0.5ms
Memory per context~300 bytes~80 bytes
10K concurrent rooms~3MB~800KB

Structs§

ContextConfig
Context window configuration.
ContextEntry
A context entry (message, tile, system prompt, etc.).
ContextStats
RoomContext
Context window state.
TokenUsage

Enums§

EntryType
EvictionPolicy
Eviction policy.