|
| 1 | +:_mod-docs-content-type: PROCEDURE |
| 2 | + |
| 3 | +[id="proc-changing-your-llm-provider_{context}"] |
| 4 | += Changing your LLM provider in {ls-short} |
| 5 | + |
| 6 | +{ls-short} operates on a link:{developer-lightspeed-link}##con-about-bring-your-own-model_appendix-about-user-data-security[_Bring Your Own Model_] approach, meaning you must provide and configure access to your preferred Large Language Model (LLM) provider for the service to function. The Road-Core Service (RCS) acts as an intermediary layer that handles the configuration and setup of these LLM providers. |
| 7 | + |
| 8 | +[IMPORTANT] |
| 9 | +==== |
| 10 | +The LLM provider configuration section includes a mandatory dummy provider block. Due to limitations of Road Core, this dummy provider must remain present when working with Lightspeed. This block is typically marked with comments (# Start: Do not remove this block and # End: Do not remove this block) and must not be removed from the configuration file. |
| 11 | +==== |
| 12 | + |
| 13 | +.Prerequisites |
| 14 | + |
| 15 | +* The path to the file containing your API token must be accessible by the RCS container, requiring the file to be mounted to the RCS container. |
| 16 | + |
| 17 | +.Procedure |
| 18 | + |
| 19 | +You can define additional LLM providers using one of two methods. |
| 20 | + |
| 21 | +* Recommended: In your Developer Lightspeed plugin configuration (For example, the `lightspeed` section within the `lightspeed-app-config.yaml` file), define the new provider or providers under the `lightspeed.servers` key as shown in the following code: |
| 22 | ++ |
| 23 | +[source,yaml] |
| 24 | +---- |
| 25 | +lightspeed: |
| 26 | + servers: |
| 27 | + - id: my-new-provider |
| 28 | + url: my-new-url |
| 29 | + token: my-new-token |
| 30 | +---- |
| 31 | + |
| 32 | +* Alternatively, you can add new LLM providers by updating the rcsconfig.yaml file. |
| 33 | +.. In the `llm_providers` section within your `rcsconfig.yaml` file, add your new provider configuration below the mandatory dummy provider block as shown in the following code: |
| 34 | ++ |
| 35 | +[source,yaml] |
| 36 | +---- |
| 37 | +llm_providers: |
| 38 | + # Start: Do not remove this block |
| 39 | + - name: dummy |
| 40 | + type: openai |
| 41 | + url: https://dummy.com |
| 42 | + models: |
| 43 | + - name: dummymodel |
| 44 | + # END: Do not remove this block |
| 45 | + - name: my-new-providers |
| 46 | + type: openai |
| 47 | + url: my-provider-url |
| 48 | + credentials_path: path/to/token |
| 49 | + disable_model_check: true |
| 50 | +---- |
| 51 | +.. If you need to define a new provider in `rcsconfig.yaml`, you must configure the following critical parameters: |
| 52 | +** `credentials_path`: Specifies the path to a `.txt` file that contains your API token. This file must be mounted and accessible by the RCS container. |
| 53 | +** `disable_model_check`: Set this field to `true` to allow the RCS to locate models through the `/v1/models` endpoint of the provider. When you set this field to `true`, you avoid the need to define model names explicitly in the configuration. |
0 commit comments