Overview

Fireworks AI provides high-performance inference for open-source models, while AWS AgentCore Runtime offers secure, serverless infrastructure for deploying AI agents at scale. This integration enables developers to build production-ready agents using Fireworks’ optimized models with AWS’s enterprise-grade deployment platform.

Prerequisites

  • AWS account with appropriate permissions
  • Fireworks AI account and API key
  • Python 3.10+
  • Amazon Bedrock AgentCore SDK

Amazon Bedrock AgentCore

Amazon Bedrock AgentCore is a suite of services that enables secure deployment and operation of AI agents at scale. AgentCore Runtime provides serverless infrastructure purpose-built for dynamic AI agents, supporting any open-source framework, protocol, and model with enterprise security and reliability. Key benefits:
  • Serverless scaling with fast cold starts
  • Built-in security and session isolation
  • Support for multi-modal payloads
  • Extended runtime support for complex agent workflows
For more information, see the AWS AgentCore documentation.

Using Fireworks AI on AgentCore

Quick Start Code

Here’s a minimal example of a Fireworks AI agent using strands framework ready for AgentCore deployment:
from strands import Agent, tool
from strands_tools import file_read, file_write
from strands.models.openai import OpenAIModel
import os
from bedrock_agentcore.runtime import BedrockAgentCoreApp

app = BedrockAgentCoreApp()

@tool
def code_python(user_prompt: str):
    """Generate Python code based on user requirements."""
    return f"Generate clean Python code for: {user_prompt}"

model = OpenAIModel(
    client_args={
        "api_key": os.getenv("FIREWORKS_API_KEY"),
        "base_url": "https://api.fireworks.ai/inference/v1",
    },
    model_id="accounts/fireworks/models/kimi-k2-instruct-0905",
    params={"max_tokens": 5000, "temperature": 0.0}
)

agent = Agent(
    model=model,
    tools=[file_read, file_write, code_python],
    system_prompt="You are a software engineer. You can read files, write files and generate python code."
)

@app.entrypoint
def strands_agent_fireworks_ai(payload):
    user_input = payload.get("prompt")
    response = agent(user_input)
    return response.message['content'][0]['text']

if __name__ == "__main__":
    app.run()

Complete Tutorial

For a full walkthrough including local development, deployment configuration, and testing examples, see our AgentCore Integration Notebook. The notebook demonstrates:
  • Local agent development and testing
  • AgentCore Runtime deployment with CodeBuild
  • Environment variable configuration for Fireworks API access
  • End-to-end invocation examples with complex coding tasks

Key Integration Points

  • Model Access: Fireworks models via OpenAI-compatible endpoint
  • Authentication: Secure API key management through AgentCore environment variables
  • Deployment: Docker containers built with AWS CodeBuild
  • Scaling: Automatic infrastructure scaling handled by AgentCore Runtime

Advanced topics:

In the example above we demonstrated using FireworksAI serverless, but AgentCore will also work on fine-tuned models and on-demand deployments. For more details see:
  1. On demand deployments
  2. Fine tuning guide
This integration combines Fireworks AI’s performance optimizations with AWS AgentCore’s enterprise security and reliability for production AI agent deployment.