|
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. Sie können auswählen, wo Sie auf das Modell zugreifen möchten, um Ihre Anforderungen an Compliance, Latenz, Verfügbarkeit und Langlebigkeit zu erfüllen.
Wenn Sie Firebase AI Logic verwenden, kann jede Ihrer Anfragen, die die Agent Platform Gemini API (formerly Vertex AI) verwenden, optional den Standort enthalten, an dem auf das Modell zugegriffen werden soll. Firebase AI Logic hat standardmäßige Standorteinstellungen.
- Bei Verwendung der neuen Initialisierungssyntax für die Agent Platform:
global - Bei Verwendung der alten Initialisierungssyntax für Vertex AI:
us-central1
Standort global
Für fast alle Gemini Modelle bietet die Agent Platform Gemini API (formerly Vertex AI) den Standort
global. Das bedeutet, dass Ihre Anfrage von einem verfügbaren
Modell im globalen Pool verarbeitet wird.
Wenn Sie den Standort global für Ihre Anfragen verwenden, können Sie Kapazitätslimits für das Modell vermeiden und Fehler vom Typ „Dienst überlastet“ (503) reduzieren.
Je nach Modell kann die Verwendung des Standorts global auch erforderlich
sein, da dies der einzige verfügbare Standort für das Modell ist (z. B. ein
Vorschau-GeminiModell).
Wann muss ein Standort explizit festgelegt werden?
Firebase AI Logic hat automatische Standardeinstellungen für den Standort (z. B.
global bei Verwendung der Initialisierungssyntax für die Agent Platform). Wenn Sie jedoch einen anderen Standort verwenden müssen oder möchten, müssen Sie den Standort explizit bei der Initialisierung des
Agent Platform Gemini API (formerly Vertex AI) Backend-Dienstes in Ihrem Code angeben.
Je nach Modell kann es erforderlich sein, einen Standort explizit festzulegen.
Wenn Ihre Anfrage versucht, auf ein Modell an einem Standort zuzugreifen, an dem es nicht verfügbar ist, erhalten Sie einen 404-Fehler mit der Meldung, dass das Modell was not found or your project does not have access to it.
Gemini Modelle in der Vorschau und experimentelle Modelle: Nur am Standort
globalverfügbar.Stabile Gemini 4.x und Gemini 3.x Modelle: Am Standort
globalund häufig auch an den Standortenusundeuverfügbar.Gemini 2.5 Modelle: An vielen Standorten verfügbar. Beachten Sie, dass Gemini Live API 2.5-Modelle nicht am Standort
globalverfügbar sind.
Eine Liste aller verfügbaren Standorte finden Sie weiter unten auf dieser Seite.
Allgemeine Fakten und Best Practices
Hier sind einige wichtige Fakten und Best Practices zu Standorten:
Kapazitätslimits gelten pro Modell, pro Region und pro Minute.
Um unerwartete Kapazitätslimits zu vermeiden, sollten Sie den Standort
globalverwenden, wenn das Modell dortglobalverfügbar ist.Sie können Firebase Remote Config verwenden, um den Standort zu steuern, an dem Sie auf das Modell zugreifen. So können Sie den Standort ändern, ohne eine neue Version Ihrer App zu veröffentlichen.
Wenn der Standort
globalfür Ihren Anwendungsfall nicht geeignet ist, können Sie explizit festlegen, wo Sie auf ein Modell zugreifen, wenn es an anderen Standorten alsglobalverfügbar ist. Sie können den Standort beispielsweise anhand des Standorts des Endnutzers festlegen, indem Sie Firebase Remote Config verwenden.
Codebeispiele
Firebase AI Logic hat automatische Standardeinstellungen für den Standort (z. B.
global bei Verwendung der Initialisierungssyntax für die Agent Platform). Wenn Sie jedoch einen anderen Standort verwenden müssen oder möchten, müssen Sie den Standort explizit bei der Initialisierung des
Agent Platform Gemini API (formerly Vertex AI) Backend-Dienstes in Ihrem Code angeben.
Ersetzen Sie LOCATION durch den Standortcode (z. B. global oder
us-central1) aus der Liste der verfügbaren Standorte
weiter unten auf dieser Seite.
Agent Platform-Syntax
Swift
Die Syntax agentPlatform ist ab Version 12.17.0 des SDK verfügbar.
// ...
// Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
// For the `agentPlatform` syntax, the default location is `global`, so
// specifying a location is usually optional since most models are supported in `global`.
let ai = FirebaseAI.firebaseAI(backend: .agentPlatform(location: "LOCATION"))
// ...
Kotlin
Die agentPlatform Syntax ist ab Version 17.15.0 des SDK
und Version 34.17.0 der Firebase Android BoM verfügbar.
// ...
// Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
// For the `agentPlatform` syntax, the default location is `global`, so
// specifying a location is usually optional since most models are supported in `global`.
val ai = Firebase.ai(backend = GenerativeBackend.agentPlatform(location = "LOCATION"))
// ...
Java
Die agentPlatform Syntax ist ab Version 17.15.0 des SDK
und Version 34.17.0 der Firebase Android BoM verfügbar.
// ...
// Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
// For the `agentPlatform` syntax, the default location is `global`, so
// specifying a location is usually optional since most models are supported in `global`.
GenerativeModel ai = FirebaseAI.getInstance(GenerativeBackend.agentPlatform("LOCATION"));
// ...
Web
Die Syntax AgentPlatformBackend ist ab Version 12.17.0 des Firebase JS SDK verfügbar.
// ...
// Initialize FirebaseApp
// Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
// For the `AgentPlatformBackend` syntax, the default location is `global`, so
// specifying a location is usually optional since most models are supported in `global`.
const ai = getAI(firebaseApp, { backend: new AgentPlatformBackend('LOCATION') });
// ...
Dart
// ...
// Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
// For the `agentPlatform` syntax, the default location is `global`, so
// specifying a location is usually optional since most models are supported in `global`.
final ai = await FirebaseAI.agentPlatform(location: 'LOCATION');
// ...
Einheit
// ...
// Initialize the Agent Platform Gemini API backend service (formerly Vertex AI).
// For the `AgentPlatform` syntax, the default location is `global`, so
// specifying a location is usually optional since most models are supported in `global`.
var ai = FirebaseAI.GetInstance(FirebaseAI.Backend.AgentPlatform(location: "LOCATION"));
// ...
Vertex AI-Syntax
Swift
Die Syntax vertexAI wurde in Version 13.0.0 des SDK entfernt.
// ...
// Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
// For the legacy `vertexAI` syntax, the default location is `us-central1`, so
// specifying a location is usually required since most models are *not* supported in `us-central1`.
let ai = FirebaseAI.firebaseAI(backend: .vertexAI(location: "LOCATION"))
// ...
Kotlin
Die vertexAI Syntax wurde in Version 18.0.0 des SDK und Version 35.0.0 von
der BoM entfernt.
// ...
// Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
// For the legacy `vertexAI` syntax, the default location is `us-central1`, so
// specifying a location is usually required since most models are *not* supported in `us-central1`.
val ai = Firebase.ai(backend = GenerativeBackend.vertexAI(location = "LOCATION"))
// ...
Java
Die vertexAI Syntax wurde in Version 18.0.0 des SDK und Version 35.0.0 von
der BoM entfernt.
// ...
// Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
// For the legacy `vertexAI` syntax, the default location is `us-central1`, so
// specifying a location is usually required since most models are *not* supported in `us-central1`.
GenerativeModel ai = FirebaseAI.getInstance(GenerativeBackend.vertexAI("LOCATION"));
// ...
Web
Die Syntax VertexAIBackend wurde in Version 13.0.0 des SDK entfernt.
// ...
// Initialize FirebaseApp
// Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
// For the legacy `VertexAIBackend` syntax, the default location is `us-central1`, so
// specifying a location is usually required since most models are *not* supported in `us-central1`.
const ai = getAI(firebaseApp, { backend: new VertexAIBackend('LOCATION') });
// ...
Dart
// ...
// Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
// For the legacy `vertexAI` syntax, the default location is `us-central1`, so
// specifying a location is usually required since most models are *not* supported in `us-central1`.
final ai = await FirebaseAI.vertexAI(location: 'LOCATION');
// ...
Einheit
// ...
// Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
// For the legacy `VertexAI` syntax, the default location is `us-central1`, so
// specifying a location is usually required since most models are *not* supported in `us-central1`.
var ai = FirebaseAI.GetInstance(FirebaseAI.Backend.VertexAI(location: "LOCATION"));
// ...
Wenn Sie einen Standort angeben, an dem das Modell nicht verfügbar ist, erhalten Sie einen 404-Fehler mit der Meldung, 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 Agent Platform angeben.
Generative AI on Agent Platform ist in den folgenden Regionen verfügbar. Einige Modelle und/oder bestimmte Versionen sind möglicherweise nicht an allen Standorten verfügbar. Weitere Informationen zur Verfügbarkeit an Standorten finden Sie in der Google Cloud Dokumentation).
Wichtige Hinweise:
Firebase AI Logic verwendet standardmäßig die folgenden Standorte:
- Bei Verwendung der neuen Initialisierungssyntax für die Agent Platform:
global - Bei Verwendung der alten Initialisierungssyntax für Vertex AI:
us-central1
- Bei Verwendung der neuen Initialisierungssyntax für die Agent Platform:
Gemini Modelle in der Vorschau und experimentelle Modelle: Nur am Standort
globalverfügbar.Stabile Gemini 4.x und Gemini 3.x Modelle: Am Standort
globalund häufig auch an den Standortenusundeuverfügbar.Gemini 2.5 Modelle: An vielen Standorten verfügbar. Beachten Sie, dass Gemini Live API 2.5-Modelle nicht am Standort
globalverfügbar sind.
Gemini 3.x und neuere Modelle
Bei Verwendung von Gemini 3.x und neueren Modellen unterstützt Firebase AI Logic die folgenden Standorte:
globaluseueurope-west2(London, Vereinigtes Königreich)asia-southeast1(Singapur)
Details zu den verfügbaren Standorten für jedes Modell finden Sie in der Google Cloud Dokumentation.
Modelle älterer Generationen
Bei Verwendung älterer Gemini Modelle (z. B. 2.5-Modelle) unterstützt Firebase AI Logic die folgenden Standorte:
Global
global
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)
Beachten Sie, dass Gemini Live API 2.5-Modelle nicht am Standort global verfügbar sind.
Details zu den verfügbaren Standorten für jedes Modell finden Sie in der Google Cloud Dokumentation.
Liste der zuvor verfügbaren, aber jetzt eingestellten Standorte :
- Es wurden noch keine Standorte eingestellt.