Skip to main content

Identifying Customers

Identifying customers making LLM calls from your applications helps -

  1. Set different token policies to different customers. For example, how many tokens they can use when trialing your software
  2. Limit token usage if malicious actors try and use your LLM features
  3. Turn on and off some customers based on product levels
  4. Shed some lower-tier customers in peak times or during LLM vendor outages (shedding means making LLM unavailable for certain users)
  5. Track analytics and usage by customer.
  6. Set the geographic restrictions to what service regions this customer needs to use. For example, only EU hosting locations.

When creating the useLLM hook or UI chat panel, in addition to your specific project_id, you can optionally pass a unique customer_id and customer_name.

We suggest the customer_id be a UUID or whatever unique identifier you use in your user database, and the name is just for reference when we show the customer to you for managing them. We expect that the customer will be a company, not an individual user, but that is up to you by choosing what customer_id you send (a company id for multiple individual users, or individual user ids)

const { send, response, idle } = useLLM(
{ project_id: [your project]

// optional - identifies your customer in the control panel
customer: {
customer_id: "123",
customer_name: "Our Best Customer, Inc.",
}
});

How we use these fields

If this is the first time that customer_id has made a call, then a new customer is created in your project with the name specified. These new customers will get the project defaults for tokens and load shedding tier. You defined these in the project settings -

Project Setting for Customers

If the project settings were as shown, the new customer gets 50000 tokens and is set to the middle load shedding tier.

If YOU DON'T want new customers to have any access until approved, set the "New Customer Initial Token Count" to 0 or blank. In this case, those customers will get a "No tokens" message until you add tokens to their account.

Managing Customers

Customer can be viewed from the Customers page.

See all customers

You can edit the customer details and click save.

Edit a customer

tip

We have a public API and Zapier plug in that allows you to integrate your CRM with the customers. You can trigger on customers running low on tokens, set their token balance based on other transaction (strip checkout for example), and even create new customers based on some purchase. See the integrations tab in the control panel for instructions. See Zapier Integration