# cjc2238/fireworks architecture

> Architecture diagram of the GitHub repository cjc2238/fireworks, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cjc2238/fireworks
- Repository: https://github.com/cjc2238/fireworks

## Overview

This repository is a hands-on Fireworks AI Python curriculum, not a single application: learners study lessons and run examples to progress from API fundamentals through agent and retrieval applications, production operations, and model customization. The README documents the overall roadmap; sampled scripts confirm representative API, RAG, agent-runtime, and evaluation behavior. Links to unsampled lessons are shown as capabilities, but their internal call wiring is not inferred.

Main entry points: [`04e_production_agents`](https://github.com/cjc2238/fireworks/tree/main/04e_production_agents) (Agent Evaluation), [`06_embeddings_rag`](https://github.com/cjc2238/fireworks/tree/main/06_embeddings_rag) (Embeddings & RAG), [`fwlearn/agent.py`](https://github.com/cjc2238/fireworks/blob/main/fwlearn/agent.py) (Agent Runtime), [`09_deployments`](https://github.com/cjc2238/fireworks/tree/main/09_deployments) (Dedicated Deployments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_foundations["API Foundations"]
  node_foundations_course["Foundations"]
  node_first_calls["API Calls"]
  node_sampling["Sampling &amp; Tokens"]
end

subgraph group_applications["Application Building"]
  node_structured["Structured Outputs"]
  node_tooling["Tool Calling"]
  node_reasoning_vision["Reasoning &amp; Vision"]
  node_rag["Embeddings &amp; RAG"]
end

subgraph group_agents["Agents Track"]
  node_advanced_tools["Advanced Tools"]
  node_agent_building["Agent Patterns"]
  node_mcp["MCP &amp; Frameworks"]
  node_agent_production["Agent Evaluation"]
end

subgraph group_operations["Production Engineering"]
  node_production["Reliability &amp; Cost"]
  node_batch["Batch Inference"]
  node_deployments["Dedicated Deployments"]
end

subgraph group_customization["Model Customization"]
  node_sft["Supervised Tuning"]
  node_rft["Reward Tuning"]
  node_training_api["Training API"]
end

subgraph group_runtime["Shared Runtime"]
  node_shared_helpers["Shared Helpers<br/>[__init__.py]"]
  node_agent_runtime["Agent Runtime<br/>[agent.py]"]
  node_tracing["Agent Tracing<br/>[tracing.py]"]
  node_control_helpers["Control-Plane Helpers<br/>[control.py]"]
end

node_learner(("Learner"))
node_fireworks{{"Fireworks APIs"}}
node_course_files["Course Lesson Files"]
node_agent_trajectories["Passing Trajectories"]

node_learner -->|"studies first"| node_foundations_course
node_learner -->|"runs examples"| node_first_calls
node_learner -->|"runs examples"| node_sampling
node_learner -->|"builds with"| node_structured
node_learner -->|"builds with"| node_tooling
node_learner -->|"studies next"| node_advanced_tools
node_learner -->|"builds agents"| node_agent_building
node_learner -->|"explores integrations"| node_mcp
node_learner -->|"evaluates agents"| node_agent_production
node_learner -->|"explores capabilities"| node_reasoning_vision
node_learner -->|"builds retrieval"| node_rag
node_learner -->|"hardens applications"| node_production
node_learner -->|"runs batch jobs"| node_batch
node_learner -->|"manages deployments"| node_deployments
node_learner -->|"trains models"| node_sft
node_learner -->|"trains with rewards"| node_rft
node_learner -->|"explores training"| node_training_api
node_foundations_course -->|"introduces APIs"| node_first_calls
node_first_calls -->|"sends inference requests"| node_fireworks
node_sampling -->|"configures generation"| node_fireworks
node_structured -->|"requests constrained output"| node_fireworks
node_tooling -->|"requests tool calls"| node_fireworks
node_agent_building -->|"uses runtime"| node_agent_runtime
node_agent_runtime -->|"requests completions"| node_fireworks
node_agent_runtime -->|"emits events"| node_tracing
node_agent_production -->|"runs evaluations with"| node_agent_runtime
node_agent_production -->|"summarizes traces"| node_tracing
node_agent_production -->|"writes passing runs"| node_agent_trajectories
node_agent_production -.->|"provides tuning data"| node_sft
node_rag -->|"chunks lesson text"| node_course_files
node_rag -->|"embeds and generates"| node_fireworks
node_rag -->|"requests reranking"| node_fireworks
node_production -->|"retries inference calls"| node_fireworks
node_deployments -->|"uses control helpers"| node_control_helpers
node_deployments -->|"manages and queries deployments"| node_fireworks
node_batch -->|"submits batch work"| node_fireworks
node_sft -->|"trains and evaluates"| node_fireworks
node_rft -->|"trains with rewards"| node_fireworks
node_training_api -->|"uses training services"| node_fireworks

click node_foundations_course "https://github.com/cjc2238/fireworks/tree/main/00_setup"
click node_first_calls "https://github.com/cjc2238/fireworks/tree/main/01_first_calls"
click node_sampling "https://github.com/cjc2238/fireworks/tree/main/02_sampling_and_tokens"
click node_structured "https://github.com/cjc2238/fireworks/tree/main/03_structured_outputs"
click node_tooling "https://github.com/cjc2238/fireworks/tree/main/04_tool_calling"
click node_reasoning_vision "https://github.com/cjc2238/fireworks/tree/main/05_reasoning_vision"
click node_rag "https://github.com/cjc2238/fireworks/tree/main/06_embeddings_rag"
click node_advanced_tools "https://github.com/cjc2238/fireworks/tree/main/04b_advanced_tool_calling"
click node_agent_building "https://github.com/cjc2238/fireworks/tree/main/04c_building_agents"
click node_mcp "https://github.com/cjc2238/fireworks/tree/main/04d_mcp_and_frameworks"
click node_agent_production "https://github.com/cjc2238/fireworks/tree/main/04e_production_agents"
click node_production "https://github.com/cjc2238/fireworks/tree/main/07_production"
click node_batch "https://github.com/cjc2238/fireworks/tree/main/08_batch"
click node_deployments "https://github.com/cjc2238/fireworks/tree/main/09_deployments"
click node_sft "https://github.com/cjc2238/fireworks/tree/main/10_fine_tuning_sft"
click node_rft "https://github.com/cjc2238/fireworks/tree/main/11_rft"
click node_training_api "https://github.com/cjc2238/fireworks/tree/main/12_training_api"
click node_shared_helpers "https://github.com/cjc2238/fireworks/blob/main/fwlearn/__init__.py"
click node_agent_runtime "https://github.com/cjc2238/fireworks/blob/main/fwlearn/agent.py"
click node_tracing "https://github.com/cjc2238/fireworks/blob/main/fwlearn/tracing.py"
click node_control_helpers "https://github.com/cjc2238/fireworks/blob/main/fwlearn/control.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_foundations_course,node_first_calls,node_sampling toneBlue
class node_structured,node_tooling,node_reasoning_vision,node_rag toneAmber
class node_advanced_tools,node_agent_building,node_mcp,node_agent_production,node_fireworks toneMint
class node_production,node_batch,node_deployments toneRose
class node_sft,node_rft,node_training_api,node_learner,node_course_files,node_agent_trajectories toneIndigo
class node_shared_helpers,node_agent_runtime,node_tracing,node_control_helpers toneTeal
```

## Components

### API Foundations

- [Foundations](https://github.com/cjc2238/fireworks/tree/main/00_setup): `00_setup`
- [API Calls](https://github.com/cjc2238/fireworks/tree/main/01_first_calls): `01_first_calls`
- [Sampling & Tokens](https://github.com/cjc2238/fireworks/tree/main/02_sampling_and_tokens): `02_sampling_and_tokens`

### Application Building

- [Structured Outputs](https://github.com/cjc2238/fireworks/tree/main/03_structured_outputs): `03_structured_outputs`
- [Tool Calling](https://github.com/cjc2238/fireworks/tree/main/04_tool_calling): `04_tool_calling`
- [Reasoning & Vision](https://github.com/cjc2238/fireworks/tree/main/05_reasoning_vision): `05_reasoning_vision`
- [Embeddings & RAG](https://github.com/cjc2238/fireworks/tree/main/06_embeddings_rag): `06_embeddings_rag`

### Agents Track

- [Advanced Tools](https://github.com/cjc2238/fireworks/tree/main/04b_advanced_tool_calling): `04b_advanced_tool_calling`
- [Agent Patterns](https://github.com/cjc2238/fireworks/tree/main/04c_building_agents): `04c_building_agents`
- [MCP & Frameworks](https://github.com/cjc2238/fireworks/tree/main/04d_mcp_and_frameworks): `04d_mcp_and_frameworks`
- [Agent Evaluation](https://github.com/cjc2238/fireworks/tree/main/04e_production_agents): `04e_production_agents`

### Production Engineering

- [Reliability & Cost](https://github.com/cjc2238/fireworks/tree/main/07_production): `07_production`
- [Batch Inference](https://github.com/cjc2238/fireworks/tree/main/08_batch): `08_batch`
- [Dedicated Deployments](https://github.com/cjc2238/fireworks/tree/main/09_deployments): `09_deployments`

### Model Customization

- [Supervised Tuning](https://github.com/cjc2238/fireworks/tree/main/10_fine_tuning_sft): `10_fine_tuning_sft`
- [Reward Tuning](https://github.com/cjc2238/fireworks/tree/main/11_rft): `11_rft`
- [Training API](https://github.com/cjc2238/fireworks/tree/main/12_training_api): `12_training_api`

### Shared Runtime

- [Shared Helpers](https://github.com/cjc2238/fireworks/blob/main/fwlearn/__init__.py): `fwlearn/__init__.py`
- [Agent Runtime](https://github.com/cjc2238/fireworks/blob/main/fwlearn/agent.py): `fwlearn/agent.py`
- [Agent Tracing](https://github.com/cjc2238/fireworks/blob/main/fwlearn/tracing.py): `fwlearn/tracing.py`
- [Control-Plane Helpers](https://github.com/cjc2238/fireworks/blob/main/fwlearn/control.py): `fwlearn/control.py`

### Other components

- **Learner**
- **Fireworks APIs**
- **Course Lesson Files**
- **Passing Trajectories**

## Connections

- Learner → Foundations: studies first
- Learner → API Calls: runs examples
- Learner → Sampling & Tokens: runs examples
- Learner → Structured Outputs: builds with
- Learner → Tool Calling: builds with
- Learner → Advanced Tools: studies next
- Learner → Agent Patterns: builds agents
- Learner → MCP & Frameworks: explores integrations
- Learner → Agent Evaluation: evaluates agents
- Learner → Reasoning & Vision: explores capabilities
- Learner → Embeddings & RAG: builds retrieval
- Learner → Reliability & Cost: hardens applications
- Learner → Batch Inference: runs batch jobs
- Learner → Dedicated Deployments: manages deployments
- Learner → Supervised Tuning: trains models
- Learner → Reward Tuning: trains with rewards
- Learner → Training API: explores training
- Foundations → API Calls: introduces APIs
- API Calls → Fireworks APIs: sends inference requests
- Sampling & Tokens → Fireworks APIs: configures generation
- Structured Outputs → Fireworks APIs: requests constrained output
- Tool Calling → Fireworks APIs: requests tool calls
- Agent Patterns → Agent Runtime: uses runtime
- Agent Runtime → Fireworks APIs: requests completions
- Agent Runtime → Agent Tracing: emits events
- Agent Evaluation → Agent Runtime: runs evaluations with
- Agent Evaluation → Agent Tracing: summarizes traces
- Agent Evaluation → Passing Trajectories: writes passing runs
- Agent Evaluation → Supervised Tuning: provides tuning data
- Embeddings & RAG → Course Lesson Files: chunks lesson text
- Embeddings & RAG → Fireworks APIs: embeds and generates
- Embeddings & RAG → Fireworks APIs: requests reranking
- Reliability & Cost → Fireworks APIs: retries inference calls
- Dedicated Deployments → Control-Plane Helpers: uses control helpers
- Dedicated Deployments → Fireworks APIs: manages and queries deployments
- Batch Inference → Fireworks APIs: submits batch work
- Supervised Tuning → Fireworks APIs: trains and evaluates
- Reward Tuning → Fireworks APIs: trains with rewards
- Training API → Fireworks APIs: uses training services
