From c4b0a62d8094e18d25cb85ee30286d5c31f4f62e Mon Sep 17 00:00:00 2001 From: RobertoBarrosoLuque <34043109+RobertoBarrosoLuque@users.noreply.github.com> Date: Fri, 26 Sep 2025 14:44:39 -0700 Subject: [PATCH 1/3] Add documentation to use FireworksAI on strands --- .../concepts/model-providers/fireworksai.md | 78 +++++++++++++++++++ docs/user-guide/quickstart.md | 1 + mkdocs.yml | 1 + 3 files changed, 80 insertions(+) create mode 100644 docs/user-guide/concepts/model-providers/fireworksai.md diff --git a/docs/user-guide/concepts/model-providers/fireworksai.md b/docs/user-guide/concepts/model-providers/fireworksai.md new file mode 100644 index 00000000..5edc826b --- /dev/null +++ b/docs/user-guide/concepts/model-providers/fireworksai.md @@ -0,0 +1,78 @@ +# FireworksAI + +[Fireworks AI](https://fireworks.ai) provides blazing fast inference for open-source language models. Fireworks AI is accessible through OpenAI's SDK via full API compatibility, allowing easy and portable integration with the Strands Agents SDK using the familiar OpenAI interface. + +## Installation + +The Strands Agents SDK provides access to Fireworks AI models through the OpenAI compatibility layer, configured as an optional dependency. To install, run: + +```bash +pip install 'strands-agents[openai]' strands-agents-tools +``` + +## Usage + +After installing the `openai` package, you can import and initialize the Strands Agents' OpenAI-compatible provider for Fireworks AI models as follows: + +```python +from strands import Agent +from strands.models.openai import OpenAIModel +from strands_tools import calculator + +model = OpenAIModel( + client_args={ + "api_key": "", + "base_url": "https://api.fireworks.ai/inference/v1", + }, + model_id="accounts/fireworks/models/deepseek-v3p1-terminus", # or see https://fireworks.ai/models + params={ + "max_tokens": 5000, + "temperature": 0.1 + } +) + +agent = Agent(model=model, tools=[calculator]) +agent("What is 2+2?") +``` + +## Configuration + +### Client Configuration + +The `client_args` configure the underlying OpenAI-compatible client. When using Fireworks AI, you must set: + +* `api_key`: Your Fireworks AI API key. Get one from the [Fireworks AI Console](https://app.fireworks.ai/settings/users/api-keys). +* `base_url`: `https://api.fireworks.ai/inference/v1` + +Refer to [OpenAI Python SDK GitHub](https://github.com/openai/openai-python) for full client options. + +### Model Configuration + +The `model_config` specifies which Fireworks AI model to use and any additional parameters. + +| Parameter | Description | Example | Options | +| ---------- | ------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------ | +| `model_id` | Model name | `accounts/fireworks/models/deepseek-v3p1-terminus` | See [Fireworks Models](https://fireworks.ai/models) | +| `params` | Model-specific parameters | `{"max_tokens": 5000, "temperature": 0.7, "top_p": 0.9}` | [API reference](https://docs.fireworks.ai/api-reference) | + +## Troubleshooting + +### `ModuleNotFoundError: No module named 'openai'` + +You must install the `openai` dependency to use this provider: + +```bash +pip install 'strands-agents[openai]' +``` + +### Unexpected model behavior? + +Ensure you're using a model ID compatible with Fireworks AI (e.g., `accounts/fireworks/models/deepseek-v3p1-terminus`, `accounts/fireworks/models/kimi-k2-instruct-0905`), and your `base_url` is set to `https://api.fireworks.ai/inference/v1`. + +## References + +* [Fireworks AI OpenAI Compatibility Guide](https://fireworks.ai/docs/tools-sdks/openai-compatibility#openai-compatibility) +* [Fireworks AI API Reference](https://docs.fireworks.ai/api-reference) +* [Fireworks AI Models](https://fireworks.ai/models) +* [OpenAI Python SDK](https://github.com/openai/openai-python) +* [Strands Agents API](../../../api-reference/models.md) \ No newline at end of file diff --git a/docs/user-guide/quickstart.md b/docs/user-guide/quickstart.md index bfc2c0bd..8184ff62 100644 --- a/docs/user-guide/quickstart.md +++ b/docs/user-guide/quickstart.md @@ -443,6 +443,7 @@ Strands Agents supports several other model providers beyond Amazon Bedrock: - **[OpenAI](concepts/model-providers/openai.md)** - Access to OpenAI or OpenAI-compatible models - **[Writer](concepts/model-providers/writer.md)** - Access to Palmyra models - **[Cohere](concepts/model-providers/cohere.md)** - Use Cohere models through an OpenAI compatible interface +- **[FireworksAI](concepts/model-providers/fireworksai.md)** - Use FireworksAI models through an OpenAI compatible interface - **[Custom Providers](concepts/model-providers/custom_model_provider.md)** - Build your own provider for specialized needs ## Capturing Streamed Data & Events diff --git a/mkdocs.yml b/mkdocs.yml index 18e6a939..68f5dd0b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -99,6 +99,7 @@ nav: - SageMaker: user-guide/concepts/model-providers/sagemaker.md - Writer: user-guide/concepts/model-providers/writer.md - Cohere: user-guide/concepts/model-providers/cohere.md + - FireworksAI: user-guide/concepts/model-providers/fireworksai.md - Custom Providers: user-guide/concepts/model-providers/custom_model_provider.md - Streaming: - Overview: user-guide/concepts/streaming/overview.md From eaf162886ec211bec54664af0a23c195da789a7a Mon Sep 17 00:00:00 2001 From: Mackenzie Zastrow Date: Fri, 3 Oct 2025 15:37:56 -0400 Subject: [PATCH 2/3] fix: Update Fireworks AI to match new community structure --- docs/community/model-providers/fireworksai.md | 80 +++++++++++++++++++ .../concepts/model-providers/fireworksai.md | 77 +----------------- mkdocs.yml | 2 +- 3 files changed, 83 insertions(+), 76 deletions(-) create mode 100644 docs/community/model-providers/fireworksai.md diff --git a/docs/community/model-providers/fireworksai.md b/docs/community/model-providers/fireworksai.md new file mode 100644 index 00000000..040bccdb --- /dev/null +++ b/docs/community/model-providers/fireworksai.md @@ -0,0 +1,80 @@ +# FireworksAI + +{{ community_contribution_banner }} + +[Fireworks AI](https://fireworks.ai) provides blazing fast inference for open-source language models. Fireworks AI is accessible through OpenAI's SDK via full API compatibility, allowing easy and portable integration with the Strands Agents SDK using the familiar OpenAI interface. + +## Installation + +The Strands Agents SDK provides access to Fireworks AI models through the OpenAI compatibility layer, configured as an optional dependency. To install, run: + +```bash +pip install 'strands-agents[openai]' strands-agents-tools +``` + +## Usage + +After installing the `openai` package, you can import and initialize the Strands Agents' OpenAI-compatible provider for Fireworks AI models as follows: + +```python +from strands import Agent +from strands.models.openai import OpenAIModel +from strands_tools import calculator + +model = OpenAIModel( + client_args={ + "api_key": "", + "base_url": "https://api.fireworks.ai/inference/v1", + }, + model_id="accounts/fireworks/models/deepseek-v3p1-terminus", # or see https://fireworks.ai/models + params={ + "max_tokens": 5000, + "temperature": 0.1 + } +) + +agent = Agent(model=model, tools=[calculator]) +agent("What is 2+2?") +``` + +## Configuration + +### Client Configuration + +The `client_args` configure the underlying OpenAI-compatible client. When using Fireworks AI, you must set: + +* `api_key`: Your Fireworks AI API key. Get one from the [Fireworks AI Console](https://app.fireworks.ai/settings/users/api-keys). +* `base_url`: `https://api.fireworks.ai/inference/v1` + +Refer to [OpenAI Python SDK GitHub](https://github.com/openai/openai-python) for full client options. + +### Model Configuration + +The `model_config` specifies which Fireworks AI model to use and any additional parameters. + +| Parameter | Description | Example | Options | +| ---------- | ------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------ | +| `model_id` | Model name | `accounts/fireworks/models/deepseek-v3p1-terminus` | See [Fireworks Models](https://fireworks.ai/models) | +| `params` | Model-specific parameters | `{"max_tokens": 5000, "temperature": 0.7, "top_p": 0.9}` | [API reference](https://docs.fireworks.ai/api-reference) | + +## Troubleshooting + +### `ModuleNotFoundError: No module named 'openai'` + +You must install the `openai` dependency to use this provider: + +```bash +pip install 'strands-agents[openai]' +``` + +### Unexpected model behavior? + +Ensure you're using a model ID compatible with Fireworks AI (e.g., `accounts/fireworks/models/deepseek-v3p1-terminus`, `accounts/fireworks/models/kimi-k2-instruct-0905`), and your `base_url` is set to `https://api.fireworks.ai/inference/v1`. + +## References + +* [Fireworks AI OpenAI Compatibility Guide](https://fireworks.ai/docs/tools-sdks/openai-compatibility#openai-compatibility) +* [Fireworks AI API Reference](https://docs.fireworks.ai/api-reference) +* [Fireworks AI Models](https://fireworks.ai/models) +* [OpenAI Python SDK](https://github.com/openai/openai-python) +* [Strands Agents API](../../api-reference/models.md) \ No newline at end of file diff --git a/docs/user-guide/concepts/model-providers/fireworksai.md b/docs/user-guide/concepts/model-providers/fireworksai.md index 5edc826b..ad2437f7 100644 --- a/docs/user-guide/concepts/model-providers/fireworksai.md +++ b/docs/user-guide/concepts/model-providers/fireworksai.md @@ -1,78 +1,5 @@ -# FireworksAI -[Fireworks AI](https://fireworks.ai) provides blazing fast inference for open-source language models. Fireworks AI is accessible through OpenAI's SDK via full API compatibility, allowing easy and portable integration with the Strands Agents SDK using the familiar OpenAI interface. + -## Installation +This guide has moved to [community/model-providers/fireworksai](../../../community/model-providers/cohere.md). -The Strands Agents SDK provides access to Fireworks AI models through the OpenAI compatibility layer, configured as an optional dependency. To install, run: - -```bash -pip install 'strands-agents[openai]' strands-agents-tools -``` - -## Usage - -After installing the `openai` package, you can import and initialize the Strands Agents' OpenAI-compatible provider for Fireworks AI models as follows: - -```python -from strands import Agent -from strands.models.openai import OpenAIModel -from strands_tools import calculator - -model = OpenAIModel( - client_args={ - "api_key": "", - "base_url": "https://api.fireworks.ai/inference/v1", - }, - model_id="accounts/fireworks/models/deepseek-v3p1-terminus", # or see https://fireworks.ai/models - params={ - "max_tokens": 5000, - "temperature": 0.1 - } -) - -agent = Agent(model=model, tools=[calculator]) -agent("What is 2+2?") -``` - -## Configuration - -### Client Configuration - -The `client_args` configure the underlying OpenAI-compatible client. When using Fireworks AI, you must set: - -* `api_key`: Your Fireworks AI API key. Get one from the [Fireworks AI Console](https://app.fireworks.ai/settings/users/api-keys). -* `base_url`: `https://api.fireworks.ai/inference/v1` - -Refer to [OpenAI Python SDK GitHub](https://github.com/openai/openai-python) for full client options. - -### Model Configuration - -The `model_config` specifies which Fireworks AI model to use and any additional parameters. - -| Parameter | Description | Example | Options | -| ---------- | ------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------ | -| `model_id` | Model name | `accounts/fireworks/models/deepseek-v3p1-terminus` | See [Fireworks Models](https://fireworks.ai/models) | -| `params` | Model-specific parameters | `{"max_tokens": 5000, "temperature": 0.7, "top_p": 0.9}` | [API reference](https://docs.fireworks.ai/api-reference) | - -## Troubleshooting - -### `ModuleNotFoundError: No module named 'openai'` - -You must install the `openai` dependency to use this provider: - -```bash -pip install 'strands-agents[openai]' -``` - -### Unexpected model behavior? - -Ensure you're using a model ID compatible with Fireworks AI (e.g., `accounts/fireworks/models/deepseek-v3p1-terminus`, `accounts/fireworks/models/kimi-k2-instruct-0905`), and your `base_url` is set to `https://api.fireworks.ai/inference/v1`. - -## References - -* [Fireworks AI OpenAI Compatibility Guide](https://fireworks.ai/docs/tools-sdks/openai-compatibility#openai-compatibility) -* [Fireworks AI API Reference](https://docs.fireworks.ai/api-reference) -* [Fireworks AI Models](https://fireworks.ai/models) -* [OpenAI Python SDK](https://github.com/openai/openai-python) -* [Strands Agents API](../../../api-reference/models.md) \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 05a61c64..6171bd53 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -100,7 +100,6 @@ nav: - OpenAI: user-guide/concepts/model-providers/openai.md - SageMaker: user-guide/concepts/model-providers/sagemaker.md - Writer: user-guide/concepts/model-providers/writer.md - - Cohere: user-guide/concepts/model-providers/cohere.md - Custom Providers: user-guide/concepts/model-providers/custom_model_provider.md - Cohere community: user-guide/concepts/model-providers/cohere.md # ALWAYS ADD A SPACE BEFORE COMMUNITY - CLOVA Studio community: user-guide/concepts/model-providers/clova-studio.md @@ -155,6 +154,7 @@ nav: - Model Providers: - Cohere: community/model-providers/cohere.md - CLOVA Studio: community/model-providers/clova-studio.md + - Fireworks AI: community/model-providers/fireworksai.md - Contribute ❤️: https://github.com/strands-agents/sdk-python/blob/main/CONTRIBUTING.md - API Reference: From 2519e6f3d0db6c6b98bb12ce57ccde76e788a393 Mon Sep 17 00:00:00 2001 From: RobertoBarrosoLuque <34043109+RobertoBarrosoLuque@users.noreply.github.com> Date: Fri, 3 Oct 2025 13:43:51 -0700 Subject: [PATCH 3/3] Fix typo --- docs/user-guide/concepts/model-providers/fireworksai.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/concepts/model-providers/fireworksai.md b/docs/user-guide/concepts/model-providers/fireworksai.md index ad2437f7..9f7912fe 100644 --- a/docs/user-guide/concepts/model-providers/fireworksai.md +++ b/docs/user-guide/concepts/model-providers/fireworksai.md @@ -1,5 +1,5 @@ -This guide has moved to [community/model-providers/fireworksai](../../../community/model-providers/cohere.md). +This guide has moved to [community/model-providers/fireworksai](../../../community/model-providers/fireworksai.md).