veloxquant_mlx.planning.workload module¶
Workload description for the auto-selection pipeline.
A WorkloadProfile captures everything about how the model will be
used that changes which KV-cache strategy fits (context length, generation
length, batch size/parallelism, raw compute vs. response-time goal). It is pure
data — no methods, just fields — so it can be round-tripped through JSON, the
benchmark database, and the CLI without impedance mismatch.
- class veloxquant_mlx.planning.workload.WorkloadProfile(context_length=4096, generation_length=512, batch_size=1, num_concurrent_requests=1, objective='balanced', max_latency_ms=None)[source]¶
Bases:
objectNormalized description of a serving workload.
- Variables:
context_length – Maximum prompt context the served cache must hold.
generation_length – Expected number of decode tokens per request.
batch_size – Parallel requests sharing the KV cache.
num_concurrent_requests – Requests served concurrently (drives how many caches the memory budget must cover).
objective – One of the
WorkloadObjectivenames; the planner uses this to weight the memory/latency/throughput/quality axes.max_latency_ms – Hard latency ceiling, when the caller knows one (used to exclude strategies whose analytical proxy exceeds it).
- Parameters:
- class veloxquant_mlx.planning.workload.WorkloadObjective[source]¶
Bases:
objectIdentifier constants for the planner’s supported objectives.
Kept as a plain object (not an Enum) so downstream code can pass arbitrary objective names; the planner’s
DEFAULT_OBJECTIVE_WEIGHTSonly assigns weights to the canonical ones below and falls back tobalancedfor anything else.- MEMORY = 'memory'¶
- LATENCY = 'latency'¶
- THROUGHPUT = 'throughput'¶
- QUALITY = 'quality'¶
- BALANCED = 'balanced'¶
- veloxquant_mlx.planning.workload.workload_from_dict(data)[source]¶
Rehydrate a
WorkloadProfilefromto_dictoutput.Missing keys take their dataclass defaults; extra keys are ignored, so the schema can grow without breaking loading of older records.
- Return type:
- Parameters: