REQ-INFER-024: Backends declare capabilities and expose state and log-probability introspection

← Requirements

What it requires

  1. Given a base backend, Then no capability is reported and info carries only the name; given an overriding backend, Then declared capabilities and populated info are reported and the capability count matches the enum.
  2. Given state operations on a backend without support or not loaded, Then they return false.
  3. Given fewer than 2 tokens or a non-ACTIVE model, Then evaluate_logprobs is rejected; given a valid sequence, Then perplexity equals exp(-mean(logprobs)), total_logprob equals the sum, and repeated calls agree.
tier
NOT_RUN

Where it lives

  • src/inference6
  • src/facade2

See it on the map

How it is met

implemented bytestsresultclear_stateentropic_compute_perplexityentropic_get_logprobsevaluate_logprobsinforestore_statesave_statesupportsLlamaCppBackend lifecycle on a small real model (one load)absententropic_compute_perplexity on configured handle without tier failsabsententropic_compute_perplexity on unconfigured handle returns INVALID_STATEabsententropic_get_logprobs on NULL handle returns INVALID_HANDLEabsententropic_get_logprobs on configured handle without active tier failsabsententropic_get_logprobs on unconfigured handle returns INVALID_STATEabsententropic_get_logprobs with n_tokens<2 returns INVALID_ARGUMENTabsentgh#100 floor: default f16 KV path on E4B QAT Q4 is unchangedabsentgh#100: q8_0 KV halves per-seq bytes and stays valid on absent

Show on the map

Implemented by

Tests (9)

Reached through calls

9 tests: 9 absent

testresultlinked byimplementers exercisedcalls away
LlamaCppBackend lifecycle on a small real model (one load)absentinferred6 of 81
entropic_compute_perplexity on configured handle without tier failsabsentinferred1 of 8: entropic_compute_perplexity1
entropic_compute_perplexity on unconfigured handle returns INVALID_STATEabsentinferred1 of 8: entropic_compute_perplexity1
entropic_get_logprobs on NULL handle returns INVALID_HANDLEabsentinferred1 of 8: entropic_get_logprobs1
entropic_get_logprobs on configured handle without active tier failsabsentinferred1 of 8: entropic_get_logprobs1
entropic_get_logprobs on unconfigured handle returns INVALID_STATEabsentinferred1 of 8: entropic_get_logprobs1
entropic_get_logprobs with n_tokens<2 returns INVALID_ARGUMENTabsentinferred1 of 8: entropic_get_logprobs1
gh#100 floor: default f16 KV path on E4B QAT Q4 is unchangedabsentinferred1 of 8: save_state2
gh#100: q8_0 KV halves per-seq bytes and stays valid on absentinferred1 of 8: save_state2