0

Provider Guides

Provider Directory explains the index layer of MTPX with practical guidance for building inspectable, tool-using agents.

Pr
Provider Directory
Chapter 026ProvidersIndexIndex
01Orientation

Provider Directory belongs to the providers track. The page breaks the idea into responsibilities, implementation rules, failure modes, and the signals you should expose in a product UI.

Use this when

Use this when you need to understand how provider directory affects a real MTPX agent before you wire it into an application.

  • What provider directory owns in the runtime.
  • How it connects to planning, tool execution, events, providers, or storage.
  • What to log, test, and expose to users when this layer is active.
  • Common mistakes that make agent systems hard to inspect.
02 / syntax starter
from mtp import Agent
from mtp.providers import Groq

agent = Agent.MTPAgent(
    provider=Groq(model="llama-3.3-70b-versatile"),
    tools=tools,
)
03 / manual

Read the system

The complete source manual—syntax, examples, linked references, edge cases, and implementation notes.

Documentation index ↗

Detailed documentation for each MTP provider. Each guide covers installation, API key setup, parameters, capabilities, and working examples.

Cloud Providers

ProviderInstallEnv VarDefault ModelDocs
Groqpip install "mtpx[groq]"GROQ_API_KEYllama-3.3-70b-versatileGROQ.md
OpenAIpip install "mtpx[openai]"OPENAI_API_KEYgpt-4oOPENAI.md
Anthropicpip install "mtpx[anthropic]"ANTHROPIC_API_KEYclaude-3-5-sonnet-20241022ANTHROPIC.md
Geminipip install "mtpx[gemini]"GEMINI_API_KEYgemini-2.0-flashGEMINI.md
Mistralpip install "mtpx[mistral]"MISTRAL_API_KEYmistral-large-latestMISTRAL.md
Coherepip install "mtpx[cohere]"COHERE_API_KEYcommand-a-03-2025COHERE.md
DeepSeekpip install "mtpx[deepseek]"DEEPSEEK_API_KEYdeepseek-chatDEEPSEEK.md
Xiaomi MiMopip install "mtpx[xiaomi]"MIMO_API_KEYmimo-v2.5-proXIAOMI.md

OpenAI-Compatible Cloud Providers

These providers use the OpenAI SDK under the hood with custom base URLs.

ProviderInstallEnv VarDefault ModelDocs
OpenRouterpip install "mtpx[openrouter]"OPENROUTER_API_KEYqwen/qwen3.6-plus-preview:freeOPENROUTER.md
SambaNovapip install "mtpx[sambanova]"SAMBANOVA_API_KEYMeta-Llama-3.1-70B-InstructSAMBANOVA.md
Cerebraspip install "mtpx[cerebras]"CEREBRAS_API_KEYllama-4-scout-17b-16e-instructCEREBRAS.md
Together AIpip install "mtpx[togetherai]"TOGETHER_API_KEYmeta-llama/Llama-4-Scout-17B-16E-InstructTOGETHER.md
Fireworks AIpip install "mtpx[fireworksai]"FIREWORKS_API_KEYaccounts/fireworks/models/llama-v3p3-70b-instructFIREWORKS.md

Local Providers

No cloud API key required. Run models on your own hardware.

ProviderInstallDefault HostDefault ModelDocs
Ollamapip install "mtpx[ollama]"http://localhost:11434qwen3OLLAMA.md
LM Studiopip install "mtpx[lmstudio]"http://127.0.0.1:1234/v1qwen3LMSTUDIO.md

Testing

ProviderInstallAPI KeyDocs
Mock PlannerNone (built-in)NoneMOCK.md

Install All Providers

bashpip install "mtpx[providers]"

This installs SDKs for: OpenAI, Ollama, Groq, Anthropic, Google Gemini, Cohere, and Mistral.

Usage Pattern

All providers follow the same pattern:

pythonfrom mtp import Agent
from mtp.providers import <ProviderAlias>

Agent.load_dotenv_if_available()  # loads API key from .env file

provider = <ProviderAlias>(model="...", ...)
tools = Agent.ToolRegistry()
agent = Agent(provider=provider, tools=tools)

reply = agent.run_loop("Your prompt here")
print(reply)
  1. Install dotenv support:
bash   pip install python-dotenv

Or with the MTP extra:

bash   pip install "mtpx[dotenv]"
  1. Copy .env.example to .env and fill in your API keys:
text   GROQ_API_KEY=gsk_your_key_here
   OPENAI_API_KEY=sk-your_key_here
   ANTHROPIC_API_KEY=sk-ant-your_key_here
   GEMINI_API_KEY=AIzaSyour_key_here
   MISTRAL_API_KEY=your_key_here
   COHERE_API_KEY=your_key_here
   DEEPSEEK_API_KEY=sk-your_key_here
   OPENROUTER_API_KEY=sk-or-your_key_here
   SAMBANOVA_API_KEY=your_key_here
   CEREBRAS_API_KEY=csk-your_key_here
   TOGETHER_API_KEY=your_key_here
   FIREWORKS_API_KEY=fw_your_key_here
   MIMO_API_KEY=your_key_here
  1. Call Agent.load_dotenv_if_available() before creating any provider. This reads the .env file and sets environment variables that the provider picks up automatically.

Provider Aliases

Each provider has a short alias and a full class name:

AliasFull Class Name
GroqGroqToolCallingProvider
OpenAIOpenAIToolCallingProvider
AnthropicAnthropicToolCallingProvider
GeminiGeminiToolCallingProvider
OllamaOllamaToolCallingProvider
LMStudioLMStudioToolCallingProvider
MistralMistralToolCallingProvider
CohereCohereToolCallingProvider
OpenRouterOpenRouterToolCallingProvider
SambaNovaSambaNovaToolCallingProvider
CerebrasCerebrasToolCallingProvider
DeepSeekDeepSeekToolCallingProvider
TogetherAITogetherAIToolCallingProvider
FireworksAIFireworksAIToolCallingProvider
XiaomiXiaomiToolCallingProvider
MockPlannerProviderSimplePlannerProvider
01

Read

Understand where Provider Directory sits in the agent loop before adding abstractions.

02

Wire

Connect the smallest useful provider, registry, store, or event stream first.

03

Observe

Expose events, logs, results, and failure states while the runtime is still moving.

04

Harden

Add policy, tests, retries, and audit traces after the behavior is visible.

Next docAnthropic Provider