Skip to main content
Source Code: src/gaia/llm/
Import: from gaia.llm import LLMClient

Detailed Spec: spec/llm-client Purpose: Unified client for local and cloud LLM providers.

LLM Client

LLMClient is an abstract base class. Use create_client() to get the right provider:

Cloud Providers

Use create_client(use_claude=True) for the Claude provider. Local and on-prem models use create_client("lemonade", base_url=..., model=...).

Local only

When the user has set network_policy to local_ai_only, LemonadeClient’s inference methods (chat_completions, completions, responses, embeddings, generate_image, create_image_variation) raise gaia.llm.local_only.CloudDisabledError for any model Lemonade’s catalog doesn’t list as local, before sending anything. create_client("claude") and ClaudeProvider raise it too. Model management (pull_model, load_model, delete_model) is unaffected. The message names the model and how to change the setting; see Local only.

Gateway migration

The openai and litellm provider adapters have been removed because they silently discarded tool calls. The litellm install extra is also removed. The OpenAI Python package remains a dependency of the Lemonade client. use_openai=True, use_chatgpt=True, and --use-chatgpt are retained only as migration-error shims: they fail before starting inference. They never switch your request to another provider. Remove these options after configuring a model in Lemonade. --use-chatgpt is no longer advertised in CLI help. Configure the upstream endpoint and credentials in your Lemonade server first, then select the model ID exposed by its catalog. base_url below is the Lemonade server URL, not the upstream OpenAI-compatible endpoint:
In the TUI, select your configured local, Fireworks, or AMD gateway model in Providers. The shared Lemonade adapter preserves native tool calls. A generic OpenAI-compatible server is not a drop-in replacement for Lemonade’s lifecycle and catalog API. Credentials belong in the server/provider configuration, not in prompts or model IDs.

Lemonade Client (AMD-Optimized)

Import: from gaia.llm.lemonade_client import DEFAULT_MODEL_NAME, DEFAULT_LEMONADE_URL