|
| 1 | +--- |
| 2 | +sidebar_label: SAP AI Core |
| 3 | +--- |
| 4 | + |
| 5 | +# Using SAP AI Core With Kilo Code |
| 6 | + |
| 7 | +Kilo Code supports accessing models through SAP AI Core, a service in the SAP Business Technology Platform that lets you efficiently run AI scenarios in a standardized, scalable, and hyperscaler-agnostic manner. |
| 8 | + |
| 9 | +**Website:** [https://help.sap.com/docs/sap-ai-core](https://help.sap.com/docs/sap-ai-core) |
| 10 | + |
| 11 | +## Prerequisites |
| 12 | + |
| 13 | +- **SAP BTP Account:** You need an active SAP Business Technology Platform account. |
| 14 | +- **SAP AI Core Service:** You must have access to the SAP AI Core service in your BTP subaccount. |
| 15 | +- **Service Instance:** Create a service instance of SAP AI Core with appropriate service plan. |
| 16 | +- **Service Key:** Generate a service key for your SAP AI Core service instance to obtain the required credentials. |
| 17 | + |
| 18 | +## Getting Credentials |
| 19 | + |
| 20 | +To use SAP AI Core with Kilo Code, you'll need to create a service key for your SAP AI Core service instance: |
| 21 | + |
| 22 | +1. **In SAP BTP Cockpit:** |
| 23 | + |
| 24 | + - Navigate to your subaccount |
| 25 | + - Go to "Services" → "Instances and Subscriptions" |
| 26 | + - Find your SAP AI Core service instance |
| 27 | + - Create a new service key |
| 28 | + |
| 29 | +2. **Service Key Information:** |
| 30 | + The service key will contain the following information you'll need: |
| 31 | + - **Client ID:** OAuth2 client identifier |
| 32 | + - **Client Secret:** OAuth2 client secret |
| 33 | + - **Auth URL:** OAuth2 authentication endpoint |
| 34 | + - **Base URL:** SAP AI Core API base URL |
| 35 | + - **Resource Group:** (Optional) Specify a resource group, defaults to "default" |
| 36 | + |
| 37 | +## Operating Modes |
| 38 | + |
| 39 | +SAP AI Core provider supports two operating modes: |
| 40 | + |
| 41 | +### Foundation Models Mode (Default) |
| 42 | + |
| 43 | +- Uses foundation models that require active deployments |
| 44 | +- Currently, supports **OpenAI models only** due to SAP AI Core SDK limitations |
| 45 | +- Requires you to have running deployments for the models you want to use |
| 46 | +- Models must have deployments in "RUNNING" status to be selectable |
| 47 | + |
| 48 | +### Orchestration Mode |
| 49 | + |
| 50 | +- Uses SAP AI Core's orchestration capabilities |
| 51 | +- Supports models from multiple providers: **Amazon, Anthropic, Google, OpenAI, and Mistral AI** |
| 52 | +- Does not require separate deployments |
| 53 | +- Provides access to a broader range of models |
| 54 | + |
| 55 | +## Model Requirements |
| 56 | + |
| 57 | +Kilo Code applies the following filters when fetching models: |
| 58 | + |
| 59 | +- **Streaming:** Models must support streaming |
| 60 | +- **Capabilities:** Models must support text generation |
| 61 | +- **Context Window:** Models must have a context window of at least 32,000 tokens |
| 62 | + |
| 63 | +## Supported Providers |
| 64 | + |
| 65 | +### Foundation Models Mode |
| 66 | + |
| 67 | +- **OpenAI:** All OpenAI models with active deployments |
| 68 | + |
| 69 | +### Orchestration Mode |
| 70 | + |
| 71 | +- **Amazon:** Amazon foundation models |
| 72 | +- **Anthropic:** Claude models |
| 73 | +- **Google:** Gemini models |
| 74 | +- **OpenAI:** ChatGPT and GPT models |
| 75 | +- **Mistral AI:** Mistral AI models |
| 76 | + |
| 77 | +The exact list of available models depends on your SAP AI Core configuration and active model offerings. |
| 78 | + |
| 79 | +## Configuration in Kilo Code |
| 80 | + |
| 81 | +1. **Open Kilo Code Settings:** Click the gear icon (<Codicon name="gear" />) in the Kilo Code panel. |
| 82 | +2. **Select Provider:** Choose "SAP AI Core" from the "API Provider" dropdown. |
| 83 | +3. **Enter Credentials:** |
| 84 | + - **Client ID:** Enter your SAP AI Core OAuth2 client ID |
| 85 | + - **Client Secret:** Enter your SAP AI Core OAuth2 client secret |
| 86 | + - **Base URL:** Enter your SAP AI Core API base URL (e.g., `https://api.ai.ml.hana.ondemand.com`) |
| 87 | + - **Auth URL:** Enter your SAP AI Core OAuth2 auth URL (e.g., `https://your-subdomain.authentication.sap.hana.ondemand.com`) |
| 88 | + - **Resource Group:** (Optional) Enter your resource group name, defaults to "default" |
| 89 | +4. **Choose Operating Mode:** |
| 90 | + - **Orchestration Mode:** Check the "Use Orchestration" checkbox for broader model access |
| 91 | + - **Foundation Models Mode:** Leave unchecked to use foundation models with deployments |
| 92 | +5. **Select Model:** Choose your desired model from the dropdown |
| 93 | +6. **Select Deployment:** (Foundation Models Mode only) Choose an active deployment for your selected model |
| 94 | + |
| 95 | +## Deployments (Foundation Models Mode) |
| 96 | + |
| 97 | +When using Foundation Models mode: |
| 98 | + |
| 99 | +- You must have active deployments for the models you want to use |
| 100 | +- Only deployments with "RUNNING" status are available for selection |
| 101 | +- Deployments in other states (PENDING, STOPPED, etc.) are shown but disabled |
| 102 | +- The interface displays the number of available deployments for each model |
| 103 | + |
| 104 | +## Tips and Notes |
| 105 | + |
| 106 | +- **Authentication:** SAP AI Core uses OAuth2 client credentials flow for authentication |
| 107 | +- **Caching:** Model and deployment information is cached for 15 and 5 minutes respectively to improve performance |
| 108 | +- **Resource Groups:** If you use multiple resource groups, specify the appropriate one in the configuration |
| 109 | +- **Permissions:** Ensure your service key has the necessary permissions to access models and deployments |
| 110 | +- **Orchestration Benefits:** Use Orchestration mode for access to a wider variety of models without managing deployments |
| 111 | +- **Foundation Models Benefits:** Use Foundation Models mode when you need more control over specific model deployments |
| 112 | + |
| 113 | +## Troubleshooting |
| 114 | + |
| 115 | +### Common Issues |
| 116 | + |
| 117 | +1. **Authentication Failures:** |
| 118 | + |
| 119 | + - Verify your Client ID and Client Secret are correct |
| 120 | + - Check that your Auth URL is properly formatted |
| 121 | + - Ensure your service key hasn't expired |
| 122 | + |
| 123 | +2. **No Models Available:** |
| 124 | + |
| 125 | + - Check that you have the necessary permissions in your resource group |
| 126 | + - Verify your Base URL is correct |
| 127 | + - In Foundation Models mode, ensure you have running deployments |
| 128 | + |
| 129 | +3. **Deployment Issues:** |
| 130 | + |
| 131 | + - Check that your deployments are in "RUNNING" status |
| 132 | + - Verify you're using the correct resource group |
| 133 | + - Review your SAP AI Core service configuration |
| 134 | + |
| 135 | +4. **Model Access:** |
| 136 | + - In Foundation Models mode, **only OpenAI models** are currently supported |
| 137 | + - Switch to Orchestration mode for access to other providers |
| 138 | + - Ensure models meet the minimum requirements (32k context window, streaming support) |
| 139 | + |
| 140 | +## Getting Started |
| 141 | + |
| 142 | +To get started with SAP AI Core: |
| 143 | + |
| 144 | +1. Set up your SAP BTP account and access SAP AI Core service |
| 145 | +2. Create a service instance and generate a service key |
| 146 | +3. Configure Kilo Code with your credentials |
| 147 | +4. Choose between Foundation Models or Orchestration mode based on your needs |
| 148 | +5. Select an appropriate model and start coding |
| 149 | + |
| 150 | +For detailed setup instructions and service configuration, visit the [SAP AI Core documentation](https://help.sap.com/docs/sap-ai-core). |
0 commit comments