AI
September 20, 2024

Your Salesforce, Your AI: The BYO LLM Solution

How you can harness the BYO LLM feature to tailor AI solutions specifically to your organization’s needs.

Your Salesforce, Your AI: The BYO LLM Solution

As artificial intelligence continues to reshape industries, Salesforce is at the forefront of enabling businesses to leverage AI in ways that align perfectly with their unique needs. With the introduction of the Bring Your Own Large Language Model (BYO LLM) feature in Salesforce, organizations can now deploy and customize their own language models within the Salesforce ecosystem. This article explores the advanced capabilities of BYO LLM, its benefits, and how it can be effectively utilized to enhance your business operations.

What is Bring Your Own LLM?

The BYO LLM feature allows Salesforce users to integrate externally-hosted large language models directly into their Salesforce environment. Whether you’re using models from OpenAI, Google, Microsoft, or Amazon, BYO LLM enables you to connect these models to Salesforce and utilize them in a variety of applications through Prompt Builder.

Key Benefits of BYO LLM

1. Tailored AI Solutions: By allowing the integration of custom or fine-tuned models, BYO LLM provides businesses with the flexibility to use AI that is specifically adapted to their operational requirements and customer interactions.

2. Enhanced Personalization: Fine-tuning your language model with organization-specific data ensures that the AI can offer more relevant and accurate responses, improving customer engagement and operational efficiency.

3. Compliance and Security: With BYO LLM, data interactions are protected by the Einstein Trust Layer, ensuring that all AI-generated content adheres to stringent security and compliance standards, particularly important for industries with rigorous data protection regulations.

Getting Started with BYO LLM

To leverage BYO LLM, your Salesforce organization needs to have Data Cloud enabled. This provides the infrastructure needed for seamless integration with Einstein 1 Studio, the platform where you can manage and configure your AI models. Additionally, you must have the Einstein for Sales, Service, or Platform add-on to access the BYO LLM capabilities.

Integration Steps

1. Connect Your Model: Start by adding your foundation model from your chosen AI provider to Salesforce Data Cloud. This involves entering necessary connection details and validating the model integration.

2. Configure and Test: Use the Model Playground in Einstein 1 Studio to configure your model’s hyperparameters and test its performance with sample prompts. This allows you to ensure that the model behaves as expected before deployment.

3. Build Custom Prompts: With the Prompt Builder, create and customize prompts that utilize your connected LLM. This tool enables you to integrate AI responses into Salesforce applications, enhancing various business processes from customer service to marketing.

4. Deploy and Monitor: After finalizing your prompts and configurations, deploy the model within Salesforce. Monitor its performance and make adjustments as necessary to optimize its effectiveness.


Leveraging the Models API for Custom AI Solutions

One of the powerful features of Salesforce’s Bring Your Own Large Language Model (BYO LLM) is its integration with the Models API. This API provides a streamlined way to interact with your custom AI models, allowing you to generate text and incorporate AI-driven functionalities directly into your Salesforce applications.

Example: Creating and Using a Generation Request

Here’s a step-by-step example of how you can use the Models API to generate text with a custom model:

1. Create a Generation Request

First, you need to set up a request to generate text. This involves specifying the model you want to use and creating the request body.

// Create generate text request
aiplatform.ModelsAPI.createGenerations_Request request = new aiplatform.ModelsAPI.createGenerations_Request();

// Specify model
request.modelName = 'sfdc_ai__DefaultGPT4';

// Create request body
aiplatform.ModelsAPI_GenerationRequest requestBody = new aiplatform.ModelsAPI_GenerationRequest();
request.body = requestBody;

// Add prompt to body
requestBody.prompt = 'Generate a welcome email for the new developer on the team, Jane Doe.';

2. Make the API Request

With the request set up, you can now call the Models API to generate the text. This example demonstrates how to handle the API response and potential errors.

try {
    // Make request
    aiplatform.ModelsAPI modelsAPI = new aiplatform.ModelsAPI();
    aiplatform.ModelsAPI.createGenerations_Response response = modelsAPI.createGenerations(request);
    System.debug('Models API response: ' + response.Code200.generation.generatedText);

// Handle error
} catch(aiplatform.ModelsAPI.createGenerations_ResponseException e) {
    System.debug('Response code: ' + e.responseCode);
    System.debug('The following exception occurred: ' + e);
}

Use Cases for Models API

The Models API opens up a range of possibilities for leveraging your custom AI models within Salesforce. Here are a few examples:

Automated Content Creation: Generate personalized emails, reports, or marketing messages tailored to your business needs.

Enhanced Customer Interaction: Create dynamic responses for chatbots or virtual assistants that understand and address customer queries more effectively.

Custom Business Logic: Integrate AI-driven insights into custom applications or workflows to improve decision-making and efficiency.

By utilizing the Models API, you can harness the full potential of your BYO LLM setup, making it an integral part of your Salesforce-powered solutions. This integration not only streamlines operations but also enhances the overall user experience by providing sophisticated, AI-driven functionalities.

Conclusion

The BYO LLM feature empowers organizations to integrate sophisticated, custom AI models into their Salesforce environment, enabling a new level of personalization and operational efficiency. By leveraging this capability, businesses can ensure their AI solutions are perfectly aligned with their unique needs while maintaining high standards of security and compliance.

By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.