From 09fd39d80fc201faa003959a99415598ac66992c Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Fri, 15 Sep 2023 13:46:50 -0700 Subject: [PATCH] vertex docs --- docs/my-website/docs/providers/vertex.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/my-website/docs/providers/vertex.md b/docs/my-website/docs/providers/vertex.md index 1870e3b684..f7824fe8b8 100644 --- a/docs/my-website/docs/providers/vertex.md +++ b/docs/my-website/docs/providers/vertex.md @@ -1,22 +1,29 @@ # VertexAI / Google Palm -LiteLLM supports chat-bison, chat-bison@001, text-bison, text-bison@001 ## Google VertexAI Models Sample notebook for calling VertexAI models: https://github.com/BerriAI/litellm/blob/main/cookbook/liteLLM_VertextAI_Example.ipynb +## Pre-requisites +* `pip install google-cloud-aiplatform` +* Authentication: + * run `gcloud auth application-default login` See [Google Cloud Docs](https://cloud.google.com/docs/authentication/external/set-up-adc) + * Alternatively you can set `application_default_credentials.json` + +## Set Vertex Project & Vertex Location All calls using Vertex AI require the following parameters: * Your Project ID `litellm.vertex_project` = "hardy-device-38811" Your Project ID * Your Project Location `litellm.vertex_location` = "us-central1" -## Pre-requisites -`pip install google-cloud-aiplatform` +## Sample Usage +```python +import litellm +litellm.vertex_project = "hardy-device-38811" # Your Project ID +litellm.vertex_location = "us-central1" # proj location -Authentication: -VertexAI uses Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information on setting this up - -VertexAI requires you to set `application_default_credentials.json`, this can be set by running `gcloud auth application-default login` in your terminal +response = completion(model="chat-bison", messages=[{"role": "user", "content": "write code for saying hi from LiteLLM"}]) +``` ## Chat Models | Model Name | Function Call |