Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 1.09 KB

README.md

File metadata and controls

22 lines (16 loc) · 1.09 KB

Local inference

The native host runs worker.ts in a separate process. The worker validates requests with the IPC schema and queues them so only one prompt uses the model at a time.

LocalInference loads a GGUF file from an absolute path. It keeps one model in memory and releases each request's session and context after use. Changing the path clears the cached model before disposing it. A failed replacement can then be retried safely.

The llama adapter checks the native module's methods and prompt results. When an invalid request has a usable ID, the worker returns the validation error with that ID. A failed reply does not prevent the next queued request from running. Disconnecting the host ends the worker process.

Run the inference tests from the repository root:

node --import ./packages/bridge/src/runner/test-source-loader.mjs --test apps/inference/test/*.test.mjs

The fixtures cover invalid requests, model changes, queue ordering and cleanup on failure. They run without downloading or loading a model.