Why deploy Prompt Chains via Maxim

  • Prompt experimentation - Create multiple versions of your prompt chains, and use a wide variety of models available on Maxim to test and compare their performance using your custom data.
  • Deploy without code changes - Deploy the final version directly from UI—no code changes required. Use Maxim’s RBAC support to limit deployment permission to key stakeholders.
  • Custom variables - Use custom variables to create rules to control which environments or user groups should receive the updates. This helps in setting up A/B tests or testing prompt variations internally before pushing to users.

Deploying a Prompt Chain

1

Navigate to Prompt Chains

Navigate to Evaluation > Prompts > Prompt Chains and open the prompt chain you want to deploy.

2

Access deployment options

Click the 🚀 icon in the header and choose to deploy the present version.

3

Add deployment rules

Add one or more rules for deployment e.g. Environment = prod.

4

Edit deployment variables

Edit or define new variables by clicking “Edit deployment variables”

5

Define variable properties

Define the name and type of any variable. For variables of type select provide possible options. e.g. Environment: Beta, Staging, Prod.

6

Deploy conditionally

Every time you have a new version to deploy, use the variable based rules to deploy conditionally.

7

View existing deployments

View existing deployments for any prompt from the deploy button in the header.

Fetching prompt chains via SDK

For building query to get prompt chain with specific deployment variables, you can use QueryBuilder.

import { Maxim, QueryBuilder } from "@maximai/maxim-js;

const maxim = new Maxim({ apiKey: "", promptManagement: true });

const prompt = await maxim.getPromptChain("prompt-chain-id",
  				new QueryBuilder()
  					.and()
  					.deploymentVar("Environment", "prod")
  					.build());

Adding multiple queries

import { Maxim, QueryBuilder } from "@maximai/maxim-js;

const maxim = new Maxim({ apiKey: "", promptManagement: true });

const prompt = await maxim.getPromptChain(
  "prompt-chain-id",
  new QueryBuilder().and().deploymentVar("Environment", "prod").deploymentVar("CustomerId", "123").build(),
);

Adding filters based on Tags

import { Maxim, QueryBuilder } from "@maximai/maxim-js;

const maxim = new Maxim({ apiKey: "", promptManagement: true});

const prompt = await maxim.getPromptChain(
  "prompt-chain-id",
  new QueryBuilder().and().deploymentVar("Environment", "prod").tag("TenantId", "3000").build(),
);