foley.agent.local_llm#
Offline / local-LLM SELECT rungs — OpenAI-compatible Decomposer / Judge / Refiner.
The offline sibling of the Anthropic-backed SELECT rungs: instead of calling the hosted
Claude API, these hit any OpenAI-compatible chat endpoint — an on-device server such as
Ollama (http://localhost:11434/v1), llama.cpp’s server, or vLLM — so
foley.find can run its LLM decomposition / judging / refinement with **nothing leaving
the device** (report 12’s offline posture). They satisfy the same
foley.agent.protocols seams and REUSE the exact system prompts + JSON schemas the
Anthropic rungs use (one prompt SSOT), differing only in the transport.
Zero-config wiring: set FOLEY_LLM_BASE_URL (+ optionally FOLEY_LLM_MODEL /
FOLEY_LLM_API_KEY) and the SELECT defaults auto-upgrade to these — see
local_llm_configured(), consulted by _default_decomposer / _default_judge /
_default_refiner. openai (the thin OpenAI client, foley[local-llm]) is imported
LAZILY inside the call path only, so import foley / import foley.agent stay dol-only;
tests inject a fake client and never touch the network.
Module Attributes
The default local model id (override per call or via |
Functions
True iff a local OpenAI-compatible endpoint is configured ( |
Classes
|
OpenAI-compatible |
|
OpenAI-compatible |
|
OpenAI-compatible |
- foley.agent.local_llm.DEFAULT_LOCAL_MODEL = 'llama3.1'#
The default local model id (override per call or via
FOLEY_LLM_MODEL).
- class foley.agent.local_llm.LocalLLMDecomposer(*, client=None, model=None, max_tokens=2000)[source]#
Bases:
objectOpenAI-compatible
Decomposer(local endpoint).
- class foley.agent.local_llm.LocalLLMJudge(*, client=None, model=None, max_tokens=500)[source]#
Bases:
objectOpenAI-compatible
Judgefor thejudgerung.