No results for ""
EXPAND ALL
  • Home
  • API docs

Create AI configs and variations

Read time: 5 minutes
Last edited: Dec 21, 2024

Overview

This topic explains how to create and update AI configs and variations.

Working with AI configs is available to members with an Admin role, Owner role, or custom role that allows AI config actions.

Create an AI config

An AI config is a resource that you create in LaunchDarkly. You can use AI configs to customize, test, and roll out new large language models (LLMs) within your generative AI applications.

To create an AI config:

  1. Click Create and choose AI config. The "Create AI config" dialog appears:
The "Create an AI config" dialog.
The "Create an AI config" dialog.
  1. Give your AI config a human-readable Name.
  • The AI config will contain a set of variations, each of which has a model, and one or more messages. The Name should reflect what this set of variations will do. You can update it later if you need to.
  1. (Optional) Click Edit key and update the AI config Key. You'll use this key to reference the AI config in your code. A suggested key auto-populates from the name you enter, but you can customize it if you wish.
AI config keys are important and permanent

After you create the AI config, you cannot modify its key. You can change an AI config's name, however, whenever you want.

  1. Click Create.

Now that you have an AI config, you can start creating variations. You can also update additional details.

Create an AI config variation

Within each AI config, you define one or more variations, each of which includes a model configuration, and one or more messages.

To create an AI config variation:

  1. Navigate to the detail page for the AI config.
  2. Select the Variations tab. A create panel appears:
The Variations tab of a newly-created AI config.
The Variations tab of a newly-created AI config.
  1. Enter a variation Name. You'll use this to refer to the variations when you set up targeting rules.

    Import from external playgrounds

    If you have already used an external playground to set up a model, model parameters, and messages, you can import that configuration into your AI config variation. Here's how:

    1. Click Import from playground.
    2. In the "Import from playground" dialog, select a provider from the Which playground are you using? menu.
    3. Paste the output from your provider's playground into the text box.
    4. Click Import.
    5. Skip to step 9 in the main procedure.
  2. Click Select a model and choose the model to use. LaunchDarkly provides a list of common models.

    LaunchDarkly does not send any data to these models

    LaunchDarkly does not send of the information that you provide when creating an AI config and its variations to any models. We do not use any of the information to fine tune any models. Your selection here is only used to suggest values for tokens and temperature, and to help you track which messages are paired with which models. This list is updated regularly. To request a new model, click the Give feedback option and let us know what models you'd like to have included.

  3. (Optional) Adjust the maximum tokens and temperature by clicking the values next to the respective icons.

  4. Use the dropdown to select the message role for the first message in this variation. The default value is "system" but you can also choose "assistant" or "user." Not all model providers support all roles.

  5. Enter the text of the message.

  • (Optional) Use standard Markdown formatting to format the message. Click the three-dot overflow menu and choose Preview to view the rendered variation. Choose Edit from the same menu to return to editing the message.
  • (Optional) Use two curly braces to indicate variables that you would like to set values for at runtime from your application. For example, enter This is an {{ example }} message if you'd like to replace {{ example }} with some other value in your application code when an end user encounters this AI config.
  • (Optional) Use two curly braces, the ldctx prefix, and dot (.) notation to indicate context attributes whose values you would like to use at runtime. For example, enter Describe the typical weather in {{ ldctx.city }} if you'd like to replace {{ ldctx.city }} with the city attribute from each context that encounters this AI config.
  • To learn more about how variables and context attributes are inserted into messages at runtime, read Customizing AI configs.
  1. (Optional) Click + Add another message and repeat steps 6 and 7 to include another message in the AI config variation.
  2. Click Save changes to save the AI config variation.

After you create an AI config and its variations, you can set up targeting rules and incorporate the AI config in your SDK.

Update AI config details

When you create an AI config, only the name and key are initially required. You can also add or update other details, including the AI config's description and tags.

To update an AI config's details:

  1. Navigate to the details page for the AI config.
  2. In the right sidebar, click the pencil icon next to the details you'd like to change.
  • You can update the Name and Description by editing the text of each.
  • You can update the Tags by adding or removing tags. When you add a tag to the AI config, you can use an existing tag or create a new one.
Tags let you sort AI configs into groups

Tags are useful for managing permissions using custom roles. For example, you can use a specific tag to determine who can update this AI config. To learn more, read Custom roles.