Skip to content

(2/6) Cache inference at do_inference - #95

Open
ErlisLushtaku wants to merge 9 commits into
cache-stack/01-local-storefrom
cache-stack/02-do-inference
Open

(2/6) Cache inference at do_inference#95
ErlisLushtaku wants to merge 9 commits into
cache-stack/01-local-storefrom
cache-stack/02-do-inference

Conversation

@ErlisLushtaku

Copy link
Copy Markdown
Collaborator

Description

Moves cache lookup and writes to do_inference.

  • PreparedModel defers backend construction until an input misses the cache.
  • Cache identity combines the canonical model input with the validated model descriptor.
  • Mixed batches run only missing inputs and restore the original output order.
  • Completion and judgement cache classes define their own stored rows.

This is stacked on #94.

Tests: uv run pytest; uv run ruff check .; uv run ruff format --check ..

Introduce PreparedModel and InferenceCache so full hits skip backend materialization, and wire one generate-and-judge path through content-addressed stores.
Keep only the lazy materialization fields needed for cache hits, and canonicalize inputs directly in do_inference.
Add short docstrings clarifying cache-identity preparation and miss-only backend materialization.
Handle only strings and LangChain chat prompt values used by current inference paths.
Remove silent cache fallbacks, share vLLM sampling defaults, and keep execution-only engine settings out of content descriptors.
Preserve the provenance required by the local store while keeping cache lookup and model materialization unchanged.
Replace role strings and conditionals with dedicated inference-cache subclasses while keeping SQLite persistence independent from inference orchestration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant