View Categories

Setting Up Secrets for LLM Model API Connection in AWS Secrets Manager

Before configuring your application to connect to various Large Language Models like Azure OpenAI, Cohere, and Anthropic, you need to create a secret in AWS Secrets Manager that contains the required API keys and endpoints for these models.

Create a Secret for LLM Model API Connection in AWS Secrets Manager #

1- Navigate to AWS Secrets Manager: #
  • Open the [AWS Management Console](https://aws.amazon.com/console/).
  • Select Secrets Manager from the services menu.
2- Create a New Secret: #
  • Choose Other type of secrets.
  • In the key value pairs section, add the following keys and values for the respective LLM models you intend to connect with:
  • Azure
    • – Azure_OPENAI_API_KEY: Your Azure OPENAI API KEY
    • – Azure_OPENAI_API_ENDPOINT: Your Azure OPENAI API ENDPOINT
  • API Version
    • – API_VERSION: API VERSION
  • Cohere API
    • – COHERE_API_KEY: Your COHERE API KEY
  • Gemini
    • – GEMINI_API_KEY: Your GEMINI API KEY
  • AI21 API
    • – AI21_API_KEY: Your AI21 API KEY
  • Anthropic API
    • – ANTHROPIC_API_KEY: Your ANTHROPIC API KEY
  • Llama API
    • – Llama_API_KEY: Your Llama API KEY
  • Open AI API
    • – OPENAI_API_KEY: Your OPENAI API KEY
3- Name Your Secret: #

Give the secret a meaningful name, such as `llm_model_api_connection`, to easily identify the purpose of the stored credentials.

4- Store the Secret: #

Save the secret in Secrets Manager to securely store and retrieve the API keys and endpoints required for connecting to various LLM models.