|
Klicken Sie auf Ihren Gemini API Anbieter, um anbieterspezifische Inhalte und Code auf dieser Seite aufzurufen. |
Die generativen KI-Modelle von Google sind in bestimmten Regionen verfügbar.
Wenn Sie den Vertex AI Gemini API Back-End-Dienst in Ihrem Code initialisieren, können Sie optional den Standort für das Modell angeben, auf das Sie zugreifen in Ihren Anfragen. Eine Liste der verfügbaren Standorte finden Sie weiter unten auf dieser Seite.
Hier sind einige wichtige Fakten und Best Practices zu Standorten:
Kapazitätslimits gelten pro Modell, pro Region und pro Minute.
Wenn Sie keinen Standort angeben, ist der Standardwert
us-central1.Um unerwartete Kapazitätslimits zu vermeiden, können Sie den Standort auf
globalfestlegen, wenn Ihr Modell denglobalStandort unterstützt.Wenn die Einstellung des Standorts auf
globalfür Ihren Anwendungsfall nicht anwendbar oder nicht unterstützt wird, können Sie explizit festlegen, wo Sie auf Modelle zugreifen. Sie können den Standort beispielsweise anhand des Standorts Ihres Endnutzers mit Firebase Remote Config festlegen.
Informationen zum Standort global
Für den Zugriff auf fast alle Gemini Modelle unterstützt die
Vertex AI Gemini API den Standort global. Das bedeutet, dass Ihre
Anfrage von einem verfügbaren Modell überall im globalen Pool verarbeitet wird.
Wenn Sie den Standort für Ihre Anfragen auf global festlegen, können Sie vermeiden, dass Sie Kapazitätslimits für das Modell erreichen, und Fehler vom Typ „Resource exhausted“ (429) reduzieren.
Codebeispiele
In diesen Beispielen wird gezeigt, wie auf ein Gemini Modell zugegriffen wird. Sie können aber auch einen Standort angeben, wenn Sie auf ein Imagen Modell zugreifen.
Ersetzen Sie LOCATION durch den Standortcode (z. B. europe-west4)
aus der Liste der verfügbaren Standorte weiter unten auf dieser Seite.
Swift
// ...
// Initialize the Vertex AI Gemini API backend service
// Specify a supported location for where you want to access the model
let ai = FirebaseAI.firebaseAI(backend: .vertexAI(location: "LOCATION"))
// Create a `GenerativeModel` instance with a model that supports your use case
let model = ai.generativeModel(modelName: "MODEL_NAME")
// ...
Kotlin
// ...
// Initialize the Vertex AI Gemini API backend service
// Specify a supported location for where you want to access the model
val model = Firebase.ai(backend = GenerativeBackend.vertexAI(location = "LOCATION"))
.generativeModel("MODEL_NAME")
// ...
Java
// ...
// Initialize the Vertex AI Gemini API backend service
// Specify a supported location for where you want to access the model
GenerativeModel ai = FirebaseAI.getInstance(GenerativeBackend.vertexAI("LOCATION"))
.generativeModel("MODEL_NAME");
GenerativeModelFutures model = GenerativeModelFutures.from(ai);
// ...
Web
// ...
// Initialize FirebaseApp
const firebaseApp = initializeApp(firebaseConfig);
// Initialize the Vertex AI Gemini API backend service
// Specify a supported location for where you want to access the model
const ai = getAI(firebaseApp, { backend: new VertexAIBackend('LOCATION') });
// Create a `GenerativeModel` instance with a model that supports your use case
const model = getGenerativeModel(ai, { model: 'MODEL_NAME' });
// ...
Dart
// ...
// Initialize the Vertex AI Gemini API backend service
// Specify a supported location for where you want to access the model
final ai = await FirebaseAI.vertexAI(location: 'LOCATION');
// Create a `GenerativeModel` instance with a model that supports your use case
final model = ai.generativeModel(model: 'MODEL_NAME');
// ...
Einheit
// ...
// Initialize the Vertex AI Gemini API backend service
// Specify a supported location for where you want to access the model
var ai = FirebaseAI.GetInstance(FirebaseAI.Backend.VertexAI(location: "LOCATION"));
// Create a `GenerativeModel` instance with a model that supports your use case
var model = ai.GetGenerativeModel(modelName: "MODEL_NAME");
// ...
Wenn Sie einen Standort angeben, an dem das Modell nicht verfügbar ist, wird ein 404-Fehler angezeigt, der besagt, dass das Modell was not found or your project does not have access to it.
Verfügbare Standorte
Google Cloud verwendet Regionen. Google Cloud speichert Kundendaten nur in der Region, die Sie für alle allgemein verfügbaren Funktionen von Generative AI on Vertex AI angeben.
Generative AI on Vertex AI ist in den folgenden Regionen verfügbar. Einige Modelle und/oder bestimmte Versionen sind möglicherweise nicht an allen Standorten verfügbar (detaillierte Informationen zur Standortverfügbarkeit finden Sie in der Google Cloud Dokumentation).
Alle Gemini Modelle (außer Gemini Live API Modelle) sind auch am Standort global verfügbar. Für alle Live API Modelle und alle Imagen
Modelle wird der Standort global nicht unterstützt.
USA
- Columbus, Ohio (
us-east5) - Dallas, Texas (
us-south1) - Iowa (
us-central1) - Las Vegas, Nevada (
us-west4) - Moncks Corner, South Carolina (
us-east1) - Virginia (
us-east4) - Oregon (
us-west1)
Kanada
- Montreal (
northamerica-northeast1)
Südamerika
- Sao Paulo, Brasilien (
southamerica-east1)
Europa
- Belgien (
europe-west1) - Finnland (
europe-north1) - Frankfurt, Deutschland (
europe-west3) - London, Vereinigtes Königreich (
europe-west2) - Madrid, Spanien (
europe-southwest1) - Mailand, Italien (
europe-west8) - Niederlande (
europe-west4) - Paris, Frankreich (
europe-west9) - Warschau, Polen (
europe-central2) - Zürich, Schweiz (
europe-west6)
Asiatisch-pazifischer Raum
- Bezirk Changhua, Taiwan (
asia-east1) - Hongkong, China (
asia-east2) - Mumbai, Indien (
asia-south1) - Seoul, Korea (
asia-northeast3) - Singapur (
asia-southeast1) - Sydney, Australien (
australia-southeast1) - Tokio, Japan (
asia-northeast1)
Naher Osten
- Dammam, Saudi-Arabien (
me-central2) - Doha, Katar (
me-central1) - Tel Aviv, Israel (
me-west1)