honcho/src/llm
Aakash Kattelu 252269e9b6
perf: lazy-load provider SDKs to cut idle memory per process (#1011)
Import anthropic/openai/google-genai only when a provider is first used
instead of at module import. CLIENTS is now populated lazily via
default_client(), which preserves the patch.dict test seam. The
embedding client defers its SDK imports the same way and dispatches on
transport instead of isinstance.

Cuts idle RSS by ~60MiB per process with all three providers configured
but unused at startup; a process that only ever calls one provider also
never pays for the other two.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-12 21:39:12 -04:00
..
backends fix(llm): support per-request provider timeouts (#832) 2026-08-04 12:43:00 -04:00
__init__.py perf: lazy-load provider SDKs to cut idle memory per process (#1011) 2026-08-12 21:39:12 -04:00
api.py Track user and session ID on Langfuse traces (#814) 2026-06-23 00:03:21 -04:00
backend.py feat(telemetry): CloudEvents + Langfuse tracing as projections over a captured LLM stream (#845) 2026-07-02 16:49:53 -04:00
caching.py Refactor clients.py to add modern features and more flexible configuration (#459) 2026-04-20 02:46:37 -04:00
capture.py feat(telemetry): CloudEvents + Langfuse tracing as projections over a captured LLM stream (#845) 2026-07-02 16:49:53 -04:00
conversation.py Refactor clients.py to add modern features and more flexible configuration (#459) 2026-04-20 02:46:37 -04:00
credentials.py Refactor clients.py to add modern features and more flexible configuration (#459) 2026-04-20 02:46:37 -04:00
executor.py perf: lazy-load provider SDKs to cut idle memory per process (#1011) 2026-08-12 21:39:12 -04:00
history_adapters.py Refactor clients.py to add modern features and more flexible configuration (#459) 2026-04-20 02:46:37 -04:00
registry.py perf: lazy-load provider SDKs to cut idle memory per process (#1011) 2026-08-12 21:39:12 -04:00
request_builder.py fix(llm): support per-request provider timeouts (#832) 2026-08-04 12:43:00 -04:00
runtime.py feat(telemetry): CloudEvents + Langfuse tracing as projections over a captured LLM stream (#845) 2026-07-02 16:49:53 -04:00
structured_output.py feat(llm backend): enable combined tool calling + structured output in the LLM backend transport layer (#907) 2026-07-15 11:47:49 -04:00
tool_loop.py feat(telemetry): CloudEvents + Langfuse tracing as projections over a captured LLM stream (#845) 2026-07-02 16:49:53 -04:00
types.py perf: lazy-load provider SDKs to cut idle memory per process (#1011) 2026-08-12 21:39:12 -04:00