> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fireworks.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS AgentCore

> Learn how to integrate and use Fireworks AI inference capabilities in Amazon AgentCore.

## 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](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/what-is-bedrock-agentcore.html).

## Using Fireworks AI on AgentCore

### Quick Start Code

Here's a minimal example of a Fireworks AI agent using [strands framework](https://strandsagents.com/latest/) ready for AgentCore deployment:

```python theme={null}
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 Cookbooks

For legacy walkthroughs covering local development, deployment configuration,
and testing, see these archived notebooks:

<CardGroup cols={2}>
  <Card title="Python SWE Agent" href="https://github.com/fw-ai/cookbook/blob/main/archived/integrations/AgentCore/runtime_with_strands_and_fireworksai_models.ipynb">
    Use FireworksAI + AgentCore Runtime to build a simple Python developer agent
  </Card>

  <Card title="Data Scientist Agent" href="https://github.com/fw-ai/cookbook/blob/main/archived/integrations/AgentCore/strands-agent-advanced-data-analysis-code-interpreter.ipynb">
    Use FireworksAI + AgentCore Code Interpreter to build a Data Scientist agent
  </Card>
</CardGroup>

The notebooks above demonstrates:

* Local agent development and testing
* [AgentCore Runtime](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agents-tools-runtime.html) deployment
* Using AgentCore Tools, specifically [Code Interpreter](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/code-interpreter-tool.html)
* 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](https://fireworks.ai/docs/guides/ondemand-deployments)
2. [Fine tuning guide](https://fireworks.ai/docs/fine-tuning/finetuning-intro)

This integration combines Fireworks AI's performance optimizations with AWS AgentCore's enterprise security and reliability for production AI agent deployment.
