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
| Metric | Python (dict + deque) | Rust (VecDeque + struct) |
|---|---|---|
| Update 1000 contexts | ~8ms | ~0.5ms |
| Memory per context | ~300 bytes | ~80 bytes |
| 10K concurrent rooms | ~3MB | ~800KB |
Structs§
- Context
Config - Context window configuration.
- Context
Entry - A context entry (message, tile, system prompt, etc.).
- Context
Stats - Room
Context - Context window state.
- Token
Usage
Enums§
- Entry
Type - Eviction
Policy - Eviction policy.