Skip to main content
Inferix

Models

smolagents is model-agnostic. Pick the wrapper that matches where your LLM runs.

InferenceClientModel

Calls a serverless hosted model (Hugging Face Inference Providers, or any compatible endpoint):

from smolagents import InferenceClientModel

model = InferenceClientModel(model_id="meta-llama/Llama-3.3-70B-Instruct")

LiteLLMModel

Routes to OpenAI, Anthropic, Google, and 100+ providers through LiteLLM:

from smolagents import LiteLLMModel

model = LiteLLMModel(model_id="anthropic/claude-sonnet-4-5", api_key="...")

OpenAIServerModel

Any OpenAI-compatible /v1/chat/completions server — including an Inferix inference endpoint:

from smolagents import OpenAIServerModel

model = OpenAIServerModel(
    model_id="your-model",
    api_base="https://inferix.co/api/v0/serverless/<id>/v1",
    api_key="INFERIX_API_KEY",
)

TransformersModel

Runs a model locally with transformers — great on a rented GPU:

from smolagents import TransformersModel

model = TransformersModel(model_id="Qwen/Qwen2.5-Coder-3B-Instruct")

    We use cookies for essential functionality and analytics. You can accept or reject analytics cookies.Cookie policy