Skip to content

Model Providers ​

Agentkit supports a wide range of LLM providers through elsai-model v2.1.1 — either the LLM factory or direct *Model classes from elsai Core.

For standalone invoke / stream usage (without agents), see LLM Models in elsai Core. Prefer the LLM factory when switching providers.

Install ​

bash
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ elsai-agents==0.3.5
pip install --extra-index-url https://core-packages.elsai.ai/root/elsai-model/ "elsai-model[openai]==2.1.1"

Add more provider extras as needed (for example "elsai-model[openai,bedrock]==2.1.1") — see LLM Models — Optional package extras.

Supported providers ​

ProviderModel classDocs
Amazon BedrockBedrockModelBedrock
Anthropic (direct)AnthropicModelAnthropic
Anthropic via Bedrock SDKAnthropicBedrockModelAnthropic
OpenAIOpenAIModelOpenAI
Google GeminiGeminiModelGemini
LiteLLMLiteLLMModelLiteLLM
Ollama (local)OllamaModelOllama
MistralMistralModelMistral
WriterWriterModelWriter
Meta Llama APILlamaAPIModelLlama API
llama.cpp (local)LlamaCppModelllama.cpp
Amazon SageMakerSageMakerAIModelSageMaker

Quick switch ​

Using the factory (recommended). Set API keys in the environment (do not hard-code secrets):

python
import os
from elsai import Agent
from elsai_model import LLM, Provider

# OpenAI — requires OPENAI_API_KEY
agent = Agent(
    model=LLM(
        provider=Provider.OPENAI,
        model="gpt-4o",
        api_key=os.environ["OPENAI_API_KEY"],
    )
)

# Gemini — requires GEMINI_API_KEY
agent = Agent(
    model=LLM(
        provider=Provider.GEMINI,
        model="gemini-2.5-flash",
        api_key=os.environ["GEMINI_API_KEY"],
    )
)

# Amazon Bedrock — requires AWS credentials; region defaults to us-west-2
agent = Agent(
    model=LLM(
        provider=Provider.BEDROCK,
        model="global.anthropic.claude-sonnet-4-6",
        region_name=os.getenv("AWS_DEFAULT_REGION", "us-west-2"),
    )
)

# Ollama (local) — no API key
agent = Agent(
    model=LLM(
        provider=Provider.OLLAMA,
        model="llama3.2",
        host="http://localhost:11434",
    )
)

Direct *Model construction still works:

python
import os
from elsai import Agent
from elsai_model.openai import OpenAIModel
from elsai_model.gemini import GeminiModel

agent = Agent(
    model=OpenAIModel(
        model_id="gpt-4o",
        client_args={"api_key": os.environ["OPENAI_API_KEY"]},
    )
)
agent = Agent(
    model=GeminiModel(
        model_id="gemini-2.5-flash",
        client_args={"api_key": os.environ["GEMINI_API_KEY"]},
    )
)

Common parameters ​

ParameterDescription
providerProvider enum or string when using LLM(provider=…, model=…)
model_idProvider model or deployment ID (on *Model classes)
modelSame role when using LLM(provider=…, model=…)
api_keyFactory shorthand merged into client_args
client_argsSDK client options (API keys, endpoints)
paramsGeneration settings (temperature, max_tokens, …)

Copyright © 2026 elsai foundry.