Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Auf dieser Seite wird beschrieben, wie Sie Vertex AI-Clientbibliotheken für Google Distributed Cloud (GDC) in einer Air-Gap-Umgebung installieren. Mit diesen Bibliotheken können Sie über Ihre Anwendung und Entwicklungsumgebung mit verschiedenen Vertex AI-Diensten interagieren. Hier erfahren Sie mehr über die Arten von Clientbibliotheken, die für Vertex AI APIs verfügbar sind, und über die Schritte zum Installieren der Bibliotheken aus der TAR-Datei.
Diese Seite richtet sich an Anwendungsentwickler in Anwendungsbetreibergruppen, die für die Einrichtung ihrer Anwendungs- und Entwicklungsumgebungen zur Aktivierung von KI-Funktionen verantwortlich sind. Weitere Informationen finden Sie unter Zielgruppen für die GDC-Dokumentation für Air-Gap-Umgebungen.
Für jeden Vertex AI-Dienst ist eine API verfügbar. Sie können zwar direkt über Rohserveranfragen mit diesen APIs interagieren, Clientbibliotheken vereinfachen jedoch den programmatischen Zugriff über unterstützte Sprachen in Distributed Cloud. Sie reduzieren den erforderlichen Code, insbesondere bei der Arbeit in Umgebungen wie einem JupyterLab-Notebook.
Sie können eine Vertex AI-Clientbibliothek mit den folgenden Methoden installieren:
Extrahieren Sie die Bibliotheksdatei direkt aus der TAR-Datei.
Verwenden Sie ein JupyterLab-Notebook, um die Bibliothek zu importieren.
Clientbibliothek aus einem Notebook importieren Weitere Informationen finden Sie unter Notebooks verwalten.
Vertex AI-Clientbibliotheken
Vertex AI bietet verschiedene Versionen von Clientbibliotheken für die Betriebssysteme CentOS und Ubuntu.
Die Namenskonventionen der Vertex AI-Clientbibliotheken in der TAR-Datei basieren auf dem Betriebssystem, dem Dienstnamen und der Version. Die Dateinamen haben das folgende Format:
OS-google-cloud-SERVICE-VERSION.tar.gz
Ersetzen Sie Folgendes:
OS: Der Name des Betriebssystems, auf dem Sie die Clientbibliothek installieren möchten. Zulässige Werte sind centos und ubuntu.
SERVICE: Der Name des Vertex AI-Dienstes, aus dem Sie die Clientbibliothek herunterladen möchten. Folgende Werte sind zulässig:
aiplatform: Die Vertex AI Platform-Clientbibliothek.
speech: die Speech-to-Text-Clientbibliothek.
translate: Die Vertex AI Translation-Clientbibliothek.
vision: Die OCR-Clientbibliothek.
VERSION: Die Versionsnummer der Clientbibliothek, z. B. 3.8.0.
Die folgende Tabelle enthält die Vertex AI-Clientbibliotheken, die von Distributed Cloud unterstützt werden:
Ersetzen Sie FOLDER_NAME durch den Pfad zum lokalen Verzeichnis, in das Sie die Bibliotheksdatei heruntergeladen haben.
Importieren Sie die Clientbibliothek mit einem Python-Script. Das folgende Beispiel zeigt einen Code-Snippet eines Python-Skripts, das die Vertex AI Translation-Clientbibliothek importiert, um zu veranschaulichen, wie Bibliotheken importiert werden:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\u003cp\u003eGoogle Distributed Cloud (GDC) air-gapped offers Vertex AI services like OCR, Vertex AI Translation, and Speech-to-Text, each with its own API accessible through client libraries.\u003c/p\u003e\n"],["\u003cp\u003eClient libraries are the recommended method for accessing Vertex AI APIs programmatically, simplifying the process compared to making raw server requests.\u003c/p\u003e\n"],["\u003cp\u003eVertex AI client libraries are available for both CentOS and Ubuntu operating systems, with filenames formatted as \u003ccode\u003eOS-google-cloud-SERVICE-VERSION.tar.gz\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eInstalling a client library involves downloading the tar file from the GDC URL, extracting it, and then using \u003ccode\u003epip\u003c/code\u003e to install it in Distributed Cloud.\u003c/p\u003e\n"],["\u003cp\u003eBefore downloading the tar file, it is mandatory that the user set up a project for Vertex AI, authenticate with gdcloud CLI and assign the \u003ccode\u003ecloud-ai-viewer\u003c/code\u003e role to a service account.\u003c/p\u003e\n"]]],[],null,["# Install Vertex AI client libraries\n\nThis page guides you through installing Vertex AI client libraries for Google Distributed Cloud (GDC) air-gapped, which let you interact with various Vertex AI services from your application and development environment. You can learn about the types of client libraries available for Vertex AI APIs and the steps for installing them from the tar file.\n\n\u003cbr /\u003e\n\nThis page is for application developers within application operator groups responsible for setting up their application and development environments to enable AI features. For more information, see [Audiences for GDC air-gapped documentation](/distributed-cloud/hosted/docs/latest/gdch/resources/audiences).\n\nEach Vertex AI service provides an API. While you can interact directly with these APIs through raw server requests, client libraries simplify programmatic access from supported languages on Distributed Cloud. They reduce the necessary code required, especially when working in environments like a JupyterLab notebook.\n\nYou can install a Vertex AI client library using these methods:\n\n- Extract the library file directly from the tar file.\n- Use a JupyterLab notebook to import the library.\n- Import a client library from a notebook. For information, see [Manage notebooks](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vertex-ai-workbench).\n\nVertex AI client libraries\n--------------------------\n\nVertex AI offers different versions of client libraries for\nCentOS and Ubuntu operating systems.\n\nThe naming conventions of Vertex AI client libraries in the tar\nfile are based on the operating system, the service name, and the version. The\nfilenames adhere to the following format: \n\n \u003cvar translate=\"no\"\u003eOS\u003c/var\u003e-google-cloud-\u003cvar translate=\"no\"\u003eSERVICE\u003c/var\u003e-\u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e.tar.gz\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eOS\u003c/var\u003e: the name of the operating system where you want to install the client library. Allowed values are `centos` and `ubuntu`.\n- \u003cvar translate=\"no\"\u003eSERVICE\u003c/var\u003e: the name of the Vertex AI\n service from which you want to download the client library. The following are\n the allowed values:\n\n - `aiplatform`: the Vertex AI Platform client library.\n - `speech`: the Speech-to-Text client library.\n - `translate`: the Vertex AI Translation client library.\n - `vision`: the OCR client library.\n- \u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e: the version number of the client library,\n such as `3.8.0`.\n\nThe following table contains the Vertex AI client libraries that\nDistributed Cloud supports:\n\n| **Important:** You must install the Vertex AI Platform client library to use Generative AI models like Text Embedding and Text Embedding Multilingual.\n\nBefore you begin\n----------------\n\nBefore downloading the tar file and extracting client libraries, follow these\nsteps:\n\n1. [Set up a project for Vertex AI](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vertex-ai-set-up-project).\n\n2. Authenticate with gdcloud CLI:\n\n gdcloud auth login\n\n For more information about how to authenticate with your configured identity\n provider, see [the gdcloud CLI authentication](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-auth).\n3. Verify that you have installed Python version 3.7.\n\nInstall a client library\n------------------------\n\nAfter completing the [prerequisites](#before-you-begin), follow these steps to\ndownload the tar file, and use the tar file to install a client library:\n\n1. Download the client library you want to install:\n\n wget https://\u003cvar translate=\"no\"\u003eGDC_URL\u003c/var\u003e/.well-known/static/client-libraries/\u003cvar translate=\"no\"\u003eCLIENT_LIBRARY\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eGDC_URL\u003c/var\u003e: the URL of your organization in GDC.\n - \u003cvar translate=\"no\"\u003eCLIENT_LIBRARY\u003c/var\u003e: the filename of the [client library](#clientlib) you want to download.\n2. Extract the library file:\n\n tar -zxf \u003cvar translate=\"no\"\u003eCLIENT_LIBRARY\u003c/var\u003e\n\n3. Install the client library in Distributed Cloud:\n\n pip install -r \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eFOLDER_NAME\u003c/span\u003e\u003c/var\u003e/requirements.txt --no-index --find-links \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eFOLDER_NAME\u003c/span\u003e\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eFOLDER_NAME\u003c/var\u003e with the path to the local\n directory where you downloaded the library file.\n4. Import the client library using a Python script. The following example shows\n a code snippet of a Python script that imports the Vertex AI Translation\n client library to illustrate what importing libraries looks like:\n\n from google.cloud import https://cloud.google.com/python/docs/reference/translate/latest/google.cloud.translate_v2.client.Client.html\n translate_client = https://cloud.google.com/python/docs/reference/translate/latest/google.cloud.translate_v2.client.Client.html.https://cloud.google.com/python/docs/reference/translate/latest/google.cloud.translate_v2.client.Client.html(\n client_options={\"\u003cvar translate=\"no\"\u003eAPI_ENDPOINT\u003c/var\u003e\": \"https://foo-translation.googleapis.com\"})\n result\n = translate_client.https://cloud.google.com/python/docs/reference/translate/latest/google.cloud.translate_v2.client.Client.html(text, target_language=\"ru\")\n\n [...]\n\n | **Note:** This code sample is not complete. To make a Vertex AI Translation request, [learn about translation features](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vertex-ai-translation) or [translate text](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/quickstart-translation).\n5. Save the Python script with a name, such as `translation-service.py`.\n\n6. Run the Python script:\n\n python \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eSCRIPT_NAME\u003c/span\u003e\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eSCRIPT_NAME\u003c/var\u003e with the name you gave to your\n Python script, such as `translation-service.py`."]]