This API reference provides detailed documentation for the key classes, functions, and data models in the Reward Kit.
The reward_function
module contains the core functionality for creating and using reward functions.
The evaluation
module provides the Evaluator
class for managing evaluation configurations and functions for creating and previewing evaluations.
Key components:
Evaluator
class: Manages metric loading, sample loading, and evaluator creation on the platform.preview_evaluation
: Previews an evaluation with sample data before deployment.create_evaluation
: Creates and deploys an evaluator to the platform.The config
module handles loading and managing configurations for the Reward Kit, typically from a rewardkit.yaml
file.
Key functions and classes:
load_config()
/ get_config()
: Load the global Reward Kit configuration.RewardKitConfig
: Pydantic model for the main configuration structure.GCPCloudRunConfig
, AWSLambdaConfig
.The models
module contains data models used throughout the Reward Kit.
The rewards
module contains specialized reward functions for specific use cases.
The server
module provides the RewardServer
class and serve
function to host reward functions as a FastAPI application.
Key components:
RewardServer
class: A class to encapsulate a reward function and run it as a server.serve()
function: A utility to quickly serve a given reward function.The auth
module provides utility functions to retrieve authentication credentials, primarily for Fireworks AI.
Key functions:
get_fireworks_api_key()
: Retrieves the Fireworks API key.get_fireworks_account_id()
: Retrieves the Fireworks account ID.The gcp_tools
module offers utilities for working with Google Cloud Platform, such as building and pushing Docker images to Artifact Registry and deploying to Cloud Run.
The packaging
module assists in preparing reward functions for deployment, for example, by generating Dockerfile content.
The platform_api
module provides functions for direct interaction with the Fireworks AI platform API, such as managing secrets.
The rl_processing
module contains tools for processing data for Reinforcement Learning workflows, such as the RLDataAligner
.
reward_kit.mcp
)This sub-package contains components related to the Model Context Protocol (MCP).
reward_kit.mcp.clients
: Provides clients for interacting with MCP-compliant servers.reward_kit.mcp_agent
)This sub-package provides a framework for building and running agents that interact with MCP servers. It includes orchestration logic, various backend implementations, and a collection of pre-built MCP servers for common tasks (e.g., filesystem, git).
The Reward Kit provides a command-line interface for common operations:
For detailed CLI documentation, see the CLI Reference.