{"id":27346,"library":"reward-kit","title":"reward-kit","description":"A Python library for defining, testing, and using reward functions, particularly for RLHF and AI alignment. Version 0.4.1, pre-1.0, active development with weekly releases.","status":"active","version":"0.4.1","language":"python","source_language":"en","source_url":"https://github.com/fireworks-ai/reward-kit","tags":["reward-function","rlhf","ai-alignment","evaluation"],"install":[{"cmd":"pip install reward-kit","lang":"bash","label":"latest release"}],"dependencies":[{"reason":"Required for tensor operations in reward functions","package":"torch","optional":false}],"imports":[{"note":"In version 0.3+ RewardFunction moved to top-level","wrong":"from reward_kit.core import RewardFunction","symbol":"RewardFunction","correct":"from reward_kit import RewardFunction"},{"note":"API changed in 0.4.0","wrong":"from reward_kit.utils import evaluate_reward","symbol":"evaluate_reward","correct":"from reward_kit import evaluate_reward"}],"quickstart":{"code":"from reward_kit import RewardFunction\nfrom reward_kit.data import MoralityQA\nimport os\n\n# Use your own API key or prompt key\napi_key = os.environ.get('REWARD_KIT_API_KEY', 'your-key-here')\n\nreward_fn = RewardFunction(model='morality', api_key=api_key)\ndataset = MoralityQA()\nscore = reward_fn.evaluate(dataset[0])\nprint(score)","lang":"python","description":"Initialize a reward function, load a dataset, and evaluate a sample."},"warnings":[{"fix":"Use 'from reward_kit import evaluate_reward' instead of 'from reward_kit.utils import evaluate_reward'","message":"In version 0.4.0, the evaluate_reward function was moved from reward_kit.utils to top-level reward_kit. Old imports will break.","severity":"breaking","affected_versions":">=0.4.0,<0.5"},{"fix":"Pass a Model enum value, e.g., reward_kit.Model.MORALITY, or keep string but expect future removal.","message":"The RewardFunction class constructor 'model' parameter changed from string to enum in 0.4.1. Strings still work but are deprecated.","severity":"breaking","affected_versions":">=0.4.1"},{"fix":"Use model='morality_v2' or reward_kit.Model.MORALITY_V2.","message":"The 'morality' model name is deprecated in favor of 'morality_v2' as of 0.4.0. The v1 model will be removed in 0.5.","severity":"deprecated","affected_versions":">=0.4.0"},{"fix":"Ensure you have internet access or expect ConnectionError.","message":"By default, reward functions require an internet connection to call remote APIs. Offline mode is not yet supported.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'pip install reward-kit' in the correct Python environment.","cause":"Library not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'reward_kit'"},{"fix":"Use 'from reward_kit import evaluate_reward' instead of 'from reward_kit.utils import evaluate_reward'.","cause":"Import path changed in version 0.4.0.","error":"AttributeError: module 'reward_kit' has no attribute 'evaluate_reward'"},{"fix":"Use 'morality_v2' or import Model enum: reward_kit.Model.MORALITY_V2.","cause":"Model name 'morality' is deprecated in 0.4.0+ and removed in some versions.","error":"ValueError: Unknown model: 'morality'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}