lasagnastack.llm¶
lasagnastack.llm
¶
make_client
¶
make_client(
model: str | None = None,
*,
reasoning_max_tokens: int = 4000,
reasoning_effort: str | None = None,
total_max_tokens: int | None = None,
) -> LLMClient
Instantiate the correct LLMClient for the given model string.
Dispatches on the provider prefix (the first path segment of the model name). The prefix is stripped before the model name is forwarded to the client constructor.
Supported prefixes:
gemini/→ :class:~lasagnastack.llm.gemini.GeminiClientopenrouter/→ :class:~lasagnastack.llm.openrouter.OpenRouterClient
When model is None, the LSNSTK_LLM_MODEL environment variable
is read, falling back to "gemini/gemini-2.5-flash".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
str | None
|
Full model string including provider prefix, e.g.
|
None
|
reasoning_max_tokens
|
int
|
Token budget for internal reasoning. Forwarded
as |
4000
|
reasoning_effort
|
str | None
|
Qualitative effort level ( |
None
|
total_max_tokens
|
int | None
|
Ceiling on all output tokens combined (reasoning +
visible response). Forwarded to |
None
|
Returns:
| Type | Description |
|---|---|
LLMClient
|
A concrete |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the provider prefix is not recognised. |