|
| 1 | +--- |
| 2 | +title: 'Kaizen Development Setup Guide' |
| 3 | +description: 'A guide to setting up the Kaizen development environment' |
| 4 | +--- |
| 5 | + |
| 6 | +# Kaizen Development Setup Guide |
| 7 | + |
| 8 | +This guide will walk you through the process of setting up the Kaizen development environment. |
| 9 | + |
| 10 | +## Step 1: Clone the Repository |
| 11 | + |
| 12 | +First, clone the Kaizen repository from GitHub: |
| 13 | + |
| 14 | +```bash |
| 15 | +git clone https://github.com/your-username/kaizen.git |
| 16 | +cd kaizen |
| 17 | +``` |
| 18 | + |
| 19 | +## Step 2: Set Up Environment Variables |
| 20 | + |
| 21 | +Copy the `.env.example` file to create a new `.env` file: |
| 22 | + |
| 23 | +```bash |
| 24 | +cp .env.example .env |
| 25 | +``` |
| 26 | + |
| 27 | +Make sure to fill in the necessary environment variables in the `.env` file. |
| 28 | + |
| 29 | +## Step 3: Configure `config.json` |
| 30 | + |
| 31 | +Create a `config.json` file in the root directory of the project. The general structure should look like this: |
| 32 | + |
| 33 | +```json |
| 34 | +{ |
| 35 | + "language_model": { |
| 36 | + "provider": "litellm", |
| 37 | + "enable_observability_logging": true, |
| 38 | + "redis_enabled": true, |
| 39 | + "models": [ |
| 40 | + { |
| 41 | + "model_name": "default", |
| 42 | + "litellm_params": { |
| 43 | + "model": "gpt-4o-mini", |
| 44 | + "input_cost_per_token": 0.000000015, |
| 45 | + "output_cost_per_token": 0.0000006 |
| 46 | + } |
| 47 | + }, |
| 48 | + { |
| 49 | + "model_name": "best", |
| 50 | + "litellm_params": { |
| 51 | + "model": "gpt-4o", |
| 52 | + "input_cost_per_token": 0.000005, |
| 53 | + "output_cost_per_token": 0.000015 |
| 54 | + } |
| 55 | + }, |
| 56 | + { |
| 57 | + "model_name": "CUSTOM_MODEL", |
| 58 | + "litellm_params": { |
| 59 | + "model": "azure_ai/MODEL_NAME", |
| 60 | + "api_key": "os.environ/CUSTOM_API_KEY", |
| 61 | + "api_base": "os.environ/CUSTOM_API_BASE" |
| 62 | + }, |
| 63 | + "model_info": { |
| 64 | + "max_tokens": 4096, |
| 65 | + "input_cost_per_token": 0.000015, |
| 66 | + "output_cost_per_token": 0.000015, |
| 67 | + "max_input_tokens": 128000, |
| 68 | + "max_output_tokens": 4096, |
| 69 | + "litellm_provider": "openai", |
| 70 | + "mode": "chat" |
| 71 | + } |
| 72 | + } |
| 73 | + ] |
| 74 | + }, |
| 75 | + "github_app": { |
| 76 | + "check_signature": false, |
| 77 | + "auto_pr_review": true, |
| 78 | + "edit_pr_desc": true, |
| 79 | + "process_on_push": true, |
| 80 | + "auto_unit_test_generation": false |
| 81 | + } |
| 82 | +} |
| 83 | +``` |
| 84 | + |
| 85 | +### Configuration Notes: |
| 86 | + |
| 87 | +- `model_name` is the type of model used for routing. You can have multiple models with the same `model_name`. |
| 88 | +- `litellm_params.model` is the actual model name by provider. Refer to the LiteLLM documentation for more details. |
| 89 | +- All API keys should be set up in the `.env` file. |
| 90 | +- You can set up custom models with custom API keys and base names. |
| 91 | + |
| 92 | +## Step 4: Running Examples |
| 93 | + |
| 94 | +Once the setup is complete, you can run any example using the following command: |
| 95 | + |
| 96 | +```bash |
| 97 | +PYTHONPATH=. poetry run python examples/basic/generate.py |
| 98 | +``` |
| 99 | + |
| 100 | +## Development and Testing |
| 101 | + |
| 102 | +To test any development changes: |
| 103 | + |
| 104 | +1. Feel free to update the examples as they use the local Kaizen files. |
| 105 | +2. Create your own tests in the `tests` directory. |
| 106 | + |
| 107 | +## Additional Resources |
| 108 | + |
| 109 | +- [LiteLLM Documentation](https://litellm.com/docs/) |
| 110 | +- [Kaizen GitHub Repository](https://github.com/Cloud-Code-Ai/kaizen) |
| 111 | + |
| 112 | +For more information or if you encounter any issues, please refer to the project's documentation or create an issue on the GitHub repository. |
0 commit comments