0

FireworksAI provider

Install and configure the Fireworks AI adapter, then run the Python example and check its capabilities.

Fi
Fireworks AI Provider
Chapter 031ProvidersCloudIndex
01Orientation

FireworksAI is the public alias for FireworksAIToolCallingProvider. This guide derives its constructor from MTPX 0.1.37.

Use this when

Install and configure the Fireworks AI adapter, then run the Python example and check its capabilities.

  • Install and configure
  • Create an agent
  • Constructor reference
  • Inspect capabilities
02 / syntax starter
python -m pip install "mtpx[fireworksai]"
mtp doctor --provider fireworksai
03 / manual

Read the system

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

Documentation index ↗

FireworksAI is the public alias for FireworksAIToolCallingProvider. This guide derives its constructor from MTPX 0.1.37.

Install and configure

bashpython -m pip install "mtpx[fireworksai]"
mtp doctor --provider fireworksai

Set FIREWORKS_API_KEY in your process environment before constructing the provider. The SDK does not automatically load .env. To use a .env file, install mtpx[dotenv] and call Agent.load_dotenv_if_available() first.

Constructor model defaults below come from this release's code. They are offline defaults, not a guarantee of current provider availability or account access. Enter an available model ID, or use /model in the terminal UI to discover models.

Create an agent

pythonfrom mtp import Agent
from mtp.providers import FireworksAI
from mtp.toolkits import CalculatorToolkit

tools = Agent.ToolRegistry()
tools.register_toolkit_loader("calculator", CalculatorToolkit())
provider = FireworksAI()
agent = Agent.MTPAgent(provider=provider, tools=tools)
print(agent.run("What is 25 * 4 + 10?", max_rounds=4))

This example makes a provider request. The offline quickstart needs no credentials.

Constructor reference

ParameterAnnotationSource default
modelstr'accounts/fireworks/models/llama-v3p3-70b-instruct'
api_keystr | NoneNone
temperaturefloat0.0
tool_choicestr | dict[str, Any]'auto'
parallel_tool_callsboolTrue
max_tokensint4096
response_formatdict[str, Any] | NoneNone
clientAny | NoneNone

Inspect capabilities

pythonprint(provider.capabilities())

Capabilities describe the adapter's tools, streaming, media, structured output, and async behavior. The selected model and account can impose further restrictions. See the provider contract.

The adapter declares the following contract in this source release:

pythondef capabilities(self) -> ProviderCapabilities:
        structured = STRUCTURED_OUTPUT_NATIVE_JSON_SCHEMA if self.response_format else STRUCTURED_OUTPUT_CLIENT_VALIDATED
        return ProviderCapabilities(
            provider="fireworks",
            supports_tool_calling=True,
            supports_parallel_tool_calls=bool(self.parallel_tool_calls),
            input_modalities=["text", "image"],
            supports_tool_media_output=True,
            supports_finalize_streaming=False,
            usage_metrics_quality=USAGE_METRICS_RICH,
            supports_reasoning_metadata=False,
            structured_output_support=structured,
            supports_native_async=False,
            allow_finalize_stream_fallback=True,
        )
01

Read

Understand where Fireworks AI Provider 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 docGemini Provider