generated from redhat-developer/new-project-template
-
Notifications
You must be signed in to change notification settings - Fork 58
RHDHBUGS-2051: Adding a new topic on adding a new llm provider #1403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
modules/developer-lightspeed/proc-changing-your-llm-provider.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| :_mod-docs-content-type: PROCEDURE | ||
|
|
||
| [id="proc-changing-your-llm-provider_{context}"] | ||
| = Changing your LLM provider in {ls-short} | ||
|
|
||
| {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. | ||
|
|
||
| [IMPORTANT] | ||
| ==== | ||
| 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. | ||
| ==== | ||
|
|
||
| .Prerequisites | ||
|
|
||
| * 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. | ||
|
|
||
| .Procedure | ||
|
|
||
| You can define additional LLM providers using either of following methods: | ||
|
|
||
| * Recommended: In your Developer Lightspeed plugin configuration (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: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| lightspeed: | ||
| servers: | ||
| - id: _<my_new_provider>_ | ||
| url: _<my_new_url>_ | ||
| token: _<my_new_token>_ | ||
| ---- | ||
| ** Alternatively, you can set the `id`, `url`, and `token` values in a Kubernetes Secret and reference them using environment variables in your application configuration as shown in the following code: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| env: | ||
| - name: _<my_new_url>_ | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: my-secret | ||
| key: _<my_new_url>_ | ||
| - name: _<my_new_provider>_ | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: my-secret | ||
| key: _<my_new_provider>_ | ||
| - name: _<my_new_token>_ | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: my-secret | ||
| key: _<my_new_token>_ | ||
| ---- | ||
| * You can add new LLM providers by updating the `rcsconfig.yaml` file. | ||
| .. 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: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| llm_providers: | ||
| # Start: Do not remove this block | ||
| - name: dummy | ||
| type: openai | ||
| url: https://dummy.com | ||
| models: | ||
| - name: dummymodel | ||
| # END: Do not remove this block | ||
| - name: _<my_new_providers>_ | ||
| type: openai | ||
| url: _<my_provider_url>_ | ||
| credentials_path: path/to/token | ||
| disable_model_check: true | ||
| ---- | ||
| .. If you need to define a new provider in `rcsconfig.yaml`, you must configure the following critical parameters: | ||
| ** `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. | ||
| ** `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. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.