diff --git a/docs/LLM Integration Guide.md b/docs/LLM Integration Guide.md new file mode 100644 index 000000000..11b6bbc31 --- /dev/null +++ b/docs/LLM Integration Guide.md @@ -0,0 +1,62 @@ + +# LLM Integration Guide + +**Description:** This guide provides detailed instructions on integrating Large Language Models (LLMs) with our platform. It covers vendor configuration, authentication, event handling, and best practices for successful implementation. + +**Target Audience:** AI developers, voice application developers, system architects + +## Supported Vendors + +Our platform currently supports integration with the following LLM vendors: + +* **OpenAI:** (GPT-3, GPT-4) - Requires an OpenAI API key. +* **Google AI:** (Gemini) - Requires a Google Cloud Platform project and API key. +* **Azure OpenAI Service:** - Requires an Azure subscription and Azure OpenAI Service deployment. + +We are continuously working to add support for more vendors. Please check back for updates. + +## Authentication Setup + +Authentication is required to securely access LLM services. The specific authentication method varies depending on the vendor. + +### OpenAI + +1. **Obtain an API Key:** Create an account on the OpenAI platform ([https://platform.openai.com/](https://platform.openai.com/)) and generate an API key. +2. **Configure the API Key:** Set the `OPENAI_API_KEY` environment variable or configure it directly in your application's configuration file. + + ```python + import os + os.environ["OPENAI_API_KEY"] = "YOUR_OPENAI_API_KEY" + ``` + +### Google AI + +1. **Create a Google Cloud Project:** Create a new project in the Google Cloud Console ([https://console.cloud.google.com/](https://console.cloud.google.com/)). +2. **Enable the Gemini API:** Enable the Gemini API for your project. +3. **Create a Service Account:** Create a service account with the necessary permissions to access the Gemini API. +4. **Download the Service Account Key:** Download the JSON key file for the service account. +5. **Configure Authentication:** Set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the path of the JSON key file. + + ```bash + export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account-key.json" + ``` + +### Azure OpenAI Service + +1. **Create an Azure Subscription:** If you don't already have one, create an Azure subscription. +2. **Create an Azure OpenAI Service Resource:** Create an Azure OpenAI Service resource in the Azure portal. +3. **Deploy a Model:** Deploy a model (e.g., `gpt-35-turbo`) to your Azure OpenAI Service resource. +4. **Obtain the API Key and Endpoint:** Retrieve the API key and endpoint URL for your deployed model from the Azure portal. +5. **Configure Authentication:** Set the `AZURE_OPENAI_API_KEY` and `AZURE_OPENAI_ENDPOINT` environment variables. + + ```python + import os + os.environ["AZURE_OPENAI_API_KEY"] = "YOUR_AZURE_OPENAI_API_KEY" + os.environ["AZURE_OPENAI_ENDPOINT"] = "YOUR_AZURE_OPENAI_ENDPOINT" + ``` + +## Configuration Options + +The following configuration options are available for LLM integration: + +| Option | Description \ No newline at end of file