Source Code:
src/gaia/llm/Import:
from gaia.llm import LLMClientDetailed 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
Usecreate_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 setnetwork_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
Theopenai 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:
Lemonade Client (AMD-Optimized)
Import:from gaia.llm.lemonade_client import DEFAULT_MODEL_NAME, DEFAULT_LEMONADE_URL
Related Topics
- Agent SDK - Higher-level chat interface
- Configuration - Setting up API keys and URLs
- Agent System - Using LLMs in agents