Skip to content

Commit 89d0114

Browse files
authored
Merge pull request #7 from reward-protocol/readme-update
rename to reward protocol on top level readme and cli
2 parents 0b5eef9 + e69d0d4 commit 89d0114

3 files changed

Lines changed: 68 additions & 68 deletions

File tree

README.md

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
# Reward Kit
1+
# Reward Protocol
22

3-
**Reward-Kit: Author, reproduce, and evaluate reward functions seamlessly on Fireworks, TRL, and your own infrastructure.**
3+
**Reward-Protocol: Author, reproduce, and evaluate reward functions seamlessly on Fireworks, TRL, and your own infrastructure.**
44

55
## Key Features
66

77
* **Easy-to-use Decorator**: Define reward functions with a simple `@reward_function` decorator.
88
* **Local Testing**: Quickly test your reward functions with sample data.
99
* **Flexible Evaluation**: Evaluate model outputs based on single or multiple custom metrics.
1010
* **Seamless Deployment**: Deploy your reward functions to platforms like Fireworks AI.
11-
* **Comprehensive CLI**: Manage reward functions, preview evaluations (`reward-kit preview`), deploy (`reward-kit deploy`), and run complex evaluation pipelines (`reward-kit run`).
11+
* **Comprehensive CLI**: Manage reward functions, preview evaluations (`reward-protocol preview`), deploy (`reward-protocol deploy`), and run complex evaluation pipelines (`reward-protocol run`).
1212
* **Simplified Dataset Integration**: Direct integration with HuggingFace datasets and on-the-fly format conversion.
1313
* **Extensible**: Designed to be adaptable for various LLM evaluation scenarios.
1414

1515
## Installation
1616

1717
```bash
18-
pip install reward-kit
18+
pip install reward-protocol
1919
```
2020

2121
### Optional TRL Extras
@@ -24,28 +24,28 @@ Install the additional dependencies required for running the TRL-based training
2424
examples:
2525

2626
```bash
27-
pip install "reward-kit[trl]"
27+
pip install "reward-protocol[trl]"
2828
```
2929

3030
## Getting Started
3131

32-
The Reward Kit simplifies the creation and deployment of reward functions for evaluating AI model outputs.
32+
Reward Protocol simplifies the creation and deployment of reward functions for evaluating AI model outputs.
3333

3434
### 1. Creating a Reward Function for Tool Calling
3535

36-
Reward Kit allows you to define custom logic to evaluate model responses. Here's an example of how you might use the built-in `exact_tool_match_reward` for evaluating tool/function calls. This reward function checks if the model's generated tool calls exactly match the expected ones.
36+
Reward Protocol allows you to define custom logic to evaluate model responses. Here's an example of how you might use the built-in `exact_tool_match_reward` for evaluating tool/function calls. This reward function checks if the model's generated tool calls exactly match the expected ones.
3737

3838
```python
3939
# This is a conceptual example of how exact_tool_match_reward is defined and used.
40-
# You would typically import it from reward_kit.rewards.function_calling.
41-
# For actual usage, you configure it in your YAML files for `reward-kit run`.
40+
# You would typically import it from reward_protocol.rewards.function_calling.
41+
# For actual usage, you configure it in your YAML files for `reward-protocol run`.
4242

43-
from reward_kit import reward_function
44-
from reward_kit.models import EvaluateResult, Message, MetricResult
43+
from reward_protocol import reward_function
44+
from reward_protocol.models import EvaluateResult, Message, MetricResult
4545
from typing import List, Dict, Any, Optional, Union
4646

4747
# Definition of exact_tool_match_reward (simplified for brevity, see source for full details)
48-
# from reward_kit.rewards.function_calling import exact_tool_match_reward, eval_tool_call
48+
# from reward_protocol.rewards.function_calling import exact_tool_match_reward, eval_tool_call
4949

5050
@reward_function
5151
def exact_tool_match_reward(
@@ -108,7 +108,7 @@ def exact_tool_match_reward(
108108
})
109109

110110
```
111-
This example illustrates the structure. The actual `exact_tool_match_reward` in `reward_kit.rewards.function_calling` handles complex parsing and comparison of tool calls.
111+
This example illustrates the structure. The actual `exact_tool_match_reward` in `reward_protocol.rewards.function_calling` handles complex parsing and comparison of tool calls.
112112

113113
### 2. Testing Your Reward Function with a Dataset
114114

@@ -137,11 +137,11 @@ Effective testing of a reward function involves evaluating it against a represen
137137

138138
**Example Test Snippet (Conceptual):**
139139

140-
While `reward-kit run` is the primary way to evaluate with datasets, here's a conceptual local test:
140+
While `reward-protocol run` is the primary way to evaluate with datasets, here's a conceptual local test:
141141

142142
```python
143-
from reward_kit.rewards.function_calling import exact_tool_match_reward # Import the actual function
144-
from reward_kit.models import Message
143+
from reward_protocol.rewards.function_calling import exact_tool_match_reward # Import the actual function
144+
from reward_protocol.models import Message
145145

146146
# Sample 1: Correct tool call
147147
test_messages_correct = [
@@ -172,25 +172,25 @@ print(f"Correct Call - Score: {result_correct.score}, Reason: {result_correct.re
172172
result_incorrect = exact_tool_match_reward(messages=test_messages_incorrect, ground_truth=ground_truth_correct)
173173
print(f"Incorrect Call - Score: {result_incorrect.score}, Reason: {result_incorrect.reason}")
174174
```
175-
This local test helps verify the reward function's logic with specific inputs. For comprehensive evaluation, use `reward-kit run` with a full dataset (see next section).
175+
This local test helps verify the reward function's logic with specific inputs. For comprehensive evaluation, use `reward-protocol run` with a full dataset (see next section).
176176

177-
### 3. Running Local Evaluations with `reward-kit run`
177+
### 3. Running Local Evaluations with `reward-protocol run`
178178

179-
For comprehensive local evaluations, especially when working with datasets and complex configurations, the `reward-kit run` command is the recommended tool. It leverages Hydra for configuration management, allowing you to define your evaluation pipeline (dataset, model, reward function, etc.) in YAML files.
179+
For comprehensive local evaluations, especially when working with datasets and complex configurations, the `reward-protocol run` command is the recommended tool. It leverages Hydra for configuration management, allowing you to define your evaluation pipeline (dataset, model, reward function, etc.) in YAML files.
180180

181181
**Example: Math Evaluation using `codeparrot/gsm8k`**
182182

183183
The `examples/math_example` demonstrates evaluating models on math word problems.
184184

185185
```bash
186186
# Ensure you are in the repository root
187-
# cd /path/to/reward-kit
187+
# cd /path/to/reward-protocol
188188

189189
# Run evaluation with the math configuration
190-
reward-kit run --config-name run_math_eval.yaml --config-path examples/math_example/conf
190+
reward-protocol run --config-name run_math_eval.yaml --config-path examples/math_example/conf
191191

192192
# Override parameters directly from the command line:
193-
reward-kit run --config-name run_math_eval.yaml --config-path examples/math_example/conf \
193+
reward-protocol run --config-name run_math_eval.yaml --config-path examples/math_example/conf \
194194
generation.model_name="accounts/fireworks/models/llama-v3p1-405b-instruct" \
195195
evaluation_params.limit_samples=10
196196
```
@@ -201,30 +201,30 @@ reward-kit run --config-name run_math_eval.yaml --config-path examples/math_exam
201201
* Generates model responses (e.g., using the Fireworks API or other configured providers).
202202
* Evaluates the generated responses using the specified reward function(s).
203203
* Saves detailed evaluation results to `<config_output_name>.jsonl` (e.g., `math_example_results.jsonl`) in a timestamped output directory (e.g., under `outputs/`).
204-
* Saves generated prompt/response pairs to `preview_input_output_pairs.jsonl` in the same output directory, suitable for inspection or re-evaluation with `reward-kit preview`.
204+
* Saves generated prompt/response pairs to `preview_input_output_pairs.jsonl` in the same output directory, suitable for inspection or re-evaluation with `reward-protocol preview`.
205205

206206
**Example: APPS Coding Evaluation**
207207

208208
The `examples/apps_coding_example` shows evaluation on code generation tasks using the `codeparrot/apps` dataset.
209209

210210
```bash
211211
# Run evaluation with the APPS coding configuration
212-
reward-kit run --config-path examples/apps_coding_example/conf --config-name run_eval
212+
reward-protocol run --config-path examples/apps_coding_example/conf --config-name run_eval
213213

214214
# Example: Limit samples for a quick test
215-
reward-kit run --config-path examples/apps_coding_example/conf --config-name run_eval evaluation_params.limit_samples=2
215+
reward-protocol run --config-path examples/apps_coding_example/conf --config-name run_eval evaluation_params.limit_samples=2
216216

217217
# Example: Disable generation to test reward function on cached responses
218-
reward-kit run --config-path examples/apps_coding_example/conf --config-name run_eval generation.enabled=false
218+
reward-protocol run --config-path examples/apps_coding_example/conf --config-name run_eval generation.enabled=false
219219
```
220220

221-
These examples showcase how `reward-kit run` can be adapted for different tasks and datasets through configuration files.
221+
These examples showcase how `reward-protocol run` can be adapted for different tasks and datasets through configuration files.
222222

223223
For more details on this command, Hydra configuration, and advanced usage, see the [CLI Overview](docs/cli_reference/cli_overview.mdx) and [Hydra Configuration Guide](docs/developer_guide/hydra_configuration.mdx).
224224

225225
### Fireworks Authentication Setup (Required for Preview/Deploy with Fireworks)
226226

227-
To interact with the Fireworks AI platform for deploying and managing evaluations (including some preview scenarios that might use remote evaluators or if `reward-kit run` uses a Fireworks-hosted model), Reward Kit needs your Fireworks AI credentials. You can configure these in two ways:
227+
To interact with the Fireworks AI platform for deploying and managing evaluations (including some preview scenarios that might use remote evaluators or if `reward-protocol run` uses a Fireworks-hosted model), Reward Protocol needs your Fireworks AI credentials. You can configure these in two ways:
228228

229229
**A. Environment Variables (Highest Priority)**
230230

@@ -240,7 +240,7 @@ export FIREWORKS_ACCOUNT_ID="your_fireworks_account_id"
240240

241241
**B. Configuration File (Lower Priority)**
242242

243-
Alternatively, you can store your credentials in a configuration file located at `~/.fireworks/auth.ini`. If environment variables are not set, Reward Kit will look for this file.
243+
Alternatively, you can store your credentials in a configuration file located at `~/.fireworks/auth.ini`. If environment variables are not set, Reward Protocol will look for this file.
244244

245245
Create the file with the following format:
246246

@@ -254,7 +254,7 @@ Replace `YOUR_FIREWORKS_API_KEY` and `YOUR_FIREWORKS_ACCOUNT_ID` with your actua
254254

255255
**Credential Sourcing Order:**
256256

257-
Reward Kit will prioritize credentials in the following order:
257+
Reward Protocol will prioritize credentials in the following order:
258258
1. Environment Variables (`FIREWORKS_API_KEY`, `FIREWORKS_ACCOUNT_ID`)
259259
2. `~/.fireworks/auth.ini` configuration file
260260

@@ -274,20 +274,20 @@ Create a JSONL file with sample conversations to evaluate:
274274
Preview your evaluation using the CLI:
275275

276276
```bash
277-
reward-kit preview --metrics-folders "word_count=./path/to/metrics" --samples ./path/to/samples.jsonl
277+
reward-protocol preview --metrics-folders "word_count=./path/to/metrics" --samples ./path/to/samples.jsonl
278278
```
279279

280280
For example
281281
```
282-
reward-kit preview --metrics-folders "word_count=examples/metrics/word_count" --samples development/CODING_DATASET.jsonl
282+
reward-protocol preview --metrics-folders "word_count=examples/metrics/word_count" --samples development/CODING_DATASET.jsonl
283283
```
284284

285285
### 5. Deploying Your Reward Function
286286

287287
Deploy your reward function to use in training workflows:
288288

289289
```bash
290-
reward-kit deploy --id my-evaluator --metrics-folders "word_count=./path/to/metrics" --force
290+
reward-protocol deploy --id my-evaluator --metrics-folders "word_count=./path/to/metrics" --force
291291
```
292292

293293
#### Local Development Server
@@ -296,7 +296,7 @@ For local development and testing, you can deploy a reward function as a local s
296296

297297
```bash
298298
# Deploy as local server with automatic tunnel (ngrok/serveo)
299-
reward-kit deploy --id test-local-serve-eval --target local-serve --function-ref dummy_rewards.simple_echo_reward --verbose --force
299+
reward-protocol deploy --id test-local-serve-eval --target local-serve --function-ref dummy_rewards.simple_echo_reward --verbose --force
300300
```
301301

302302
**What this does:**
@@ -309,15 +309,15 @@ reward-kit deploy --id test-local-serve-eval --target local-serve --function-ref
309309
- The CLI returns to prompt after deployment, but the server continues running in background
310310
- Check running processes: `ps aux | grep -E "(generic_server|ngrok)"`
311311
- Test locally: `curl -X POST http://localhost:8001/evaluate -H "Content-Type: application/json" -d '{"messages": [{"role": "user", "content": "test"}]}'`
312-
- Monitor logs: `tail -f logs/reward-kit-local/generic_server_*.log`
312+
- Monitor logs: `tail -f logs/reward-protocol-local/generic_server_*.log`
313313
- Stop server: Kill the background processes manually when done
314314

315315
This is ideal for development, testing webhook integrations, or accessing your reward function from remote services without full cloud deployment.
316316

317317
Or deploy programmatically:
318318

319319
```python
320-
from reward_kit.evaluation import create_evaluation
320+
from reward_protocol.evaluation import create_evaluation
321321

322322
evaluator = create_evaluation(
323323
evaluator_id="my-evaluator",
@@ -335,8 +335,8 @@ evaluator = create_evaluation(
335335
Combine multiple metrics in a single reward function:
336336

337337
```python
338-
from reward_kit import reward_function
339-
from reward_kit.models import EvaluateResult, MetricResult, Message # Assuming models are here
338+
from reward_protocol import reward_function
339+
from reward_protocol.models import EvaluateResult, MetricResult, Message # Assuming models are here
340340
from typing import List, Dict, Any, Optional
341341

342342
@reward_function
@@ -401,15 +401,15 @@ my_function.deploy(
401401

402402
## Dataset Integration
403403

404-
Reward Kit provides seamless integration with popular datasets through a simplified configuration system:
404+
Reward Protocol provides seamless integration with popular datasets through a simplified configuration system:
405405

406406
### Direct HuggingFace Integration
407407

408408
Load datasets directly from HuggingFace Hub without manual preprocessing:
409409

410410
```bash
411411
# Evaluate using GSM8K dataset with math-specific prompts
412-
reward-kit run --config-name run_math_eval.yaml --config-path examples/math_example/conf
412+
reward-protocol run --config-name run_math_eval.yaml --config-path examples/math_example/conf
413413
```
414414

415415
### Derived Datasets
@@ -447,15 +447,15 @@ Check the `examples` directory for complete examples:
447447

448448
- `evaluation_preview_example.py`: How to preview an evaluator.
449449
- `deploy_example.py`: How to deploy a reward function to Fireworks.
450-
- `math_example/`: Demonstrates CLI-based evaluation (`reward-kit run`) and TRL GRPO training for math problems (GSM8K dataset).
451-
- `apps_coding_example/`: Shows CLI-based evaluation (`reward-kit run`) for code generation tasks (APPS dataset).
452-
- `apps_coding_example/`: Shows CLI-based evaluation (`reward-kit run`) for code generation tasks (APPS dataset).
450+
- `math_example/`: Demonstrates CLI-based evaluation (`reward-protocol run`) and TRL GRPO training for math problems (GSM8K dataset).
451+
- `apps_coding_example/`: Shows CLI-based evaluation (`reward-protocol run`) for code generation tasks (APPS dataset).
452+
- `apps_coding_example/`: Shows CLI-based evaluation (`reward-protocol run`) for code generation tasks (APPS dataset).
453453

454-
The OpenEvals project provides a suite of evaluators that can be used directly within Reward Kit. The helper `reward_kit.integrations.openeval.adapt` converts any OpenEvals evaluator into a reward function returning an `EvaluateResult`.
454+
The OpenEvals project provides a suite of evaluators that can be used directly within Reward Protocol. The helper `reward_protocol.integrations.openeval.adapt` converts any OpenEvals evaluator into a reward function returning an `EvaluateResult`.
455455

456456
```python
457457
from openevals import exact_match
458-
from reward_kit.integrations.openeval import adapt
458+
from reward_protocol.integrations.openeval import adapt
459459
460460
exact_match_reward = adapt(exact_match)
461461
result = exact_match_reward(
@@ -466,13 +466,13 @@ print(result.score)
466466
```
467467

468468
The [deepeval](https://github.com/confident-ai/deepeval) project also offers a
469-
variety of metrics. The helper `reward_kit.integrations.deepeval.adapt_metric`
469+
variety of metrics. The helper `reward_protocol.integrations.deepeval.adapt_metric`
470470
converts a deepeval metric instance into a reward function returning an
471471
`EvaluateResult`.
472472

473473
```python
474474
from deepeval.metrics import FaithfulnessMetric
475-
from reward_kit.integrations.deepeval import adapt_metric
475+
from reward_protocol.integrations.deepeval import adapt_metric
476476
477477
faithfulness_reward = adapt_metric(FaithfulnessMetric())
478478
result = faithfulness_reward(
@@ -489,7 +489,7 @@ way:
489489
```python
490490
from deepeval.metrics import GEval
491491
from deepeval.test_case import LLMTestCaseParams
492-
from reward_kit.integrations.deepeval import adapt_metric
492+
from reward_protocol.integrations.deepeval import adapt_metric
493493
494494
correctness_metric = GEval(
495495
name="Correctness",
@@ -511,22 +511,22 @@ print(result.score)
511511

512512
## Command Line Interface
513513

514-
The Reward Kit includes a CLI for common operations:
514+
Reward Protocol includes a CLI for common operations:
515515

516516
```bash
517517
# Show help
518-
reward-kit --help
518+
reward-protocol --help
519519
520520
# Preview an evaluator
521-
reward-kit preview --metrics-folders "metric=./path" --samples ./samples.jsonl
521+
reward-protocol preview --metrics-folders "metric=./path" --samples ./samples.jsonl
522522
523523
# Deploy an evaluator
524-
reward-kit deploy --id my-evaluator --metrics-folders "metric=./path" --force
524+
reward-protocol deploy --id my-evaluator --metrics-folders "metric=./path" --force
525525
```
526526

527527
## Community and Support
528528

529-
* **GitHub Issues**: For bug reports and feature requests, please use [GitHub Issues](https://github.com/fireworks-ai/reward-kit/issues).
529+
* **GitHub Issues**: For bug reports and feature requests, please use [GitHub Issues](https://github.com/reward-protocol/python-sdk/issues).
530530
* **GitHub Discussions**: (If enabled) For general questions, ideas, and discussions.
531531
* Please also review our [Contributing Guidelines](development/CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md).
532532

@@ -541,7 +541,7 @@ The codebase uses mypy for static type checking. To run type checking:
541541
pip install -e ".[dev]"
542542
543543
# Run mypy
544-
mypy reward_kit
544+
mypy reward_protocol
545545
```
546546

547547
Our CI pipeline enforces type checking, so please ensure your code passes mypy checks before submitting PRs.
@@ -562,4 +562,4 @@ We are dedicated to providing a welcoming and inclusive experience for everyone.
562562

563563
## License
564564

565-
Reward Kit is released under the Apache License 2.0.
565+
Reward Protocol is released under the Apache License 2.0.

0 commit comments

Comments
 (0)