reward-kit
CLI. The example uses a basic hello_world_reward
function found in examples/gcp_cloud_run_deployment_example/dummy_rewards.py
.
reward-kit deploy
command automates much of this process, including containerization and service configuration.
examples/gcp_cloud_run_deployment_example/
:
dummy_rewards.py
: Contains a basic hello_world_reward
function used for this deployment example.rewardkit.example.yaml
: An example configuration file for reward-kit
. This shows the structure for rewardkit.yaml
if you choose to use one for GCP settings.gcloud
CLI: Google Cloud CLI installed and authenticated (gcloud auth login
, gcloud auth application-default login
).gcloud
needs sufficient permissions (e.g., roles like “Cloud Build Editor”, “Artifact Registry Administrator”, “Cloud Run Admin”, “Secret Manager Admin”).reward-kit
installed: Ensure reward-kit
is installed in your Python environment (e.g., pip install reward-kit
).rewardkit.yaml
Configuration (Optional but Recommended)reward-kit
CLI can pick up GCP settings from a rewardkit.yaml
file located in the directory from which you run the reward-kit deploy
command.
rewardkit.yaml
:
You can copy the examples/gcp_cloud_run_deployment_example/rewardkit.example.yaml
to the directory where you intend to run reward-kit deploy
(this could be the example directory itself, or your project root). Rename it to rewardkit.yaml
.
rewardkit.yaml
:
Open rewardkit.yaml
and replace placeholders with your actual GCP Project ID and desired region.
Example rewardkit.yaml
:
rewardkit.yaml
file, you must provide all necessary GCP parameters (like --gcp-project YOUR_PROJECT_ID
, --gcp-region YOUR_REGION
) directly in the reward-kit deploy
command.
dummy_rewards.py
) and your rewardkit.yaml
(if used), for example, from examples/gcp_cloud_run_deployment_example/
.
--id my-dummy-gcp-evaluator
: A unique ID for your evaluator on the Fireworks AI platform.--target gcp-cloud-run
: Specifies deployment to GCP Cloud Run.--function-ref dummy_rewards.hello_world_reward
: The Python import path to your reward function. If dummy_rewards.py
is in the current directory, this reference works.--gcp-auth-mode api-key
: Configures the Cloud Run service with API key authentication. reward-kit
will generate a key, store it in GCP Secret Manager, and configure the service. The key is also saved to your local rewardkit.yaml
under evaluator_endpoint_keys
. This is the default if not specified.--verbose
: Shows detailed output, including gcloud
commands being executed.--force
: (Optional) If an evaluator with the same --id
already exists, this flag will delete the existing one before creating the new one.reward-kit
will:
reward-kit-evaluators
, or as specified in rewardkit.yaml
).api-key
auth is used, create a GCP Secret to store the generated API key.curl
or reward-kit preview --remote-url <your-cloud-run-url>
.
If using curl
with API key authentication:
rewardkit.yaml
(if one is used in the command’s directory) under evaluator_endpoint_keys: { "my-dummy-gcp-evaluator": "YOUR_KEY" }
.hello_world_reward
function.