From 31fbb095c2c365ef30caf132265fe12cff0ef153 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Tue, 26 Dec 2023 22:16:08 +0530 Subject: [PATCH] docs(user_keys.md): update code example --- docs/my-website/docs/proxy/user_keys.md | 2 +- docs/my-website/docs/secret.md | 37 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/docs/my-website/docs/proxy/user_keys.md b/docs/my-website/docs/proxy/user_keys.md index a02ebafc4..42e295757 100644 --- a/docs/my-website/docs/proxy/user_keys.md +++ b/docs/my-website/docs/proxy/user_keys.md @@ -38,7 +38,7 @@ print(response) const { OpenAI } = require('openai'); const openai = new OpenAI({ - apiKey: "sk-1234", // This is the default and can be omitted + apiKey: "sk-1234", baseURL: "http://0.0.0.0:8000" }); diff --git a/docs/my-website/docs/secret.md b/docs/my-website/docs/secret.md index 2c61f8d49..7234a8544 100644 --- a/docs/my-website/docs/secret.md +++ b/docs/my-website/docs/secret.md @@ -2,6 +2,7 @@ LiteLLM supports reading secrets from Azure Key Vault and Infisical - [Azure Key Vault](#azure-key-vault) +- Google Key Management Service - [Infisical Secret Manager](#infisical-secret-manager) - [.env Files](#env-files) @@ -70,6 +71,42 @@ litellm --config /path/to/config.yaml [Quick Test Proxy](./proxy/quick_start#using-litellm-proxy---curl-request-openai-package-langchain-langchain-js) +## Google Key Management Service + +Use encrypted keys from Google KMS on the proxy + +### Usage with OpenAI Proxy Server + +## Step 1. Add keys to env +``` +export GOOGLE_APPLICATION_CREDENTIALS="/path/to/credentials.json" +export GOOGLE_KMS_RESOURCE_NAME="projects/*/locations/*/keyRings/*/cryptoKeys/*" +export PROXY_DATABASE_URL_ENCRYPTED=b'\n$\x00D\xac\xb4/\x8e\xc...' +``` + +## Step 2: Update Config + +```yaml +general_settings: + use_google_kms: true + database_url: "os.environ/PROXY_DATABASE_URL_ENCRYPTED" + master_key: sk-1234 +``` + +## Step 3: Start + test proxy + +``` +$ litellm --config /path/to/config.yaml +``` + +And in another terminal +``` +$ litellm --test +``` + +[Quick Test Proxy](./proxy/quick_start#using-litellm-proxy---curl-request-openai-package-langchain-langchain-js) + + ## Infisical Secret Manager Integrates with [Infisical's Secret Manager](https://infisical.com/) for secure storage and retrieval of API keys and sensitive data.