|
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, damit Ihre Anforderungen an Compliance, Latenz, Verfügbarkeit und Langlebigkeit erfüllt werden.
Wenn Sie Firebase AI Logic verwenden, kann jede Ihrer Anfragen, die die Agent Platform Gemini API (formerly Vertex AI) verwendet, 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 älteren Initialisierungssyntax für Vertex AI:
us-central1
Für fast alle Gemini Modelle unterstützt 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 für Ihre Anfragen den Standort global verwenden, können Sie Kapazitätslimits für das Modell vermeiden und die Anzahl der Fehler vom Typ „Dienst überlastet“ (503) reduzieren. Je nach Modell kann die Verwendung des Standorts global auch erforderlich sein.
Wann muss ein Standort explizit festgelegt werden?
Firebase AI Logic hat automatische Standardwerte 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 bei der Initialisierung des
Agent Platform Gemini API (formerly Vertex AI) Backend-Dienstes in Ihrem Code explizit angeben.
Je nach Modell kann die explizite Festlegung eines Standorts erforderlich sein.
Wenn Ihre Anfrage versucht, auf ein Modell an einem Standort zuzugreifen, an dem es nicht verfügbar ist, wird ein 404-Fehler zurückgegeben, der besagt, dass das Modell was not found or your project does not have access to it.
Gemini Gemini- und Testmodelle: Nur am Standort
globalverfügbar (außer für Live API Modelle, siehe unten).Gemini 3.x Modelle: Nur verfügbar am Standort
globalbei Verwendung von Firebase AI Logic. Firebase AI Logic unterstützt die Standorteusundeunoch nicht.Gemini 2.5 Modelle: An vielen Standorten verfügbar.
Gemini Live API Modelle: Nur am Standort
us-central1verfügbar. Der Standortglobalwird nicht unterstützt.
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 Ihr Modell den Standortglobalunterstützt).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 die Verwendung des Standorts
globalfür Ihren Anwendungsfall nicht geeignet oder nicht unterstützt wird, sollten Sie explizit festlegen, wo Sie auf Modelle zugreifen. Sie können den Standort beispielsweise anhand des Standorts des Endnutzers festlegen, indem Sie Firebase Remote Config verwenden.
Codebeispiele
Firebase AI Logic hat automatische Standardwerte 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 bei der Initialisierung des
Agent Platform Gemini API (formerly Vertex AI) Backend-Dienstes in Ihrem Code explizit angeben.
Ersetzen Sie LOCATION durch den Standortcode (z. B. global oder
europe-west4) aus der Liste der verfügbaren Standorte
weiter unten auf dieser Seite.
Agent Platform-Syntax
Swift
// ...
// 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
// ...
// 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
// ...
// 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
// ...
// 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 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`.
var ai = FirebaseAI.GetInstance(FirebaseAI.Backend.AgentPlatform(location: "LOCATION"));
// ...
Vertex AI-Syntax
Swift
// ...
// Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
// For the legacy `vertexai` syntax, the default location is `us-central`, so
// specifying a location is usually required since most models are *not* supported in `us-central`.
let ai = FirebaseAI.firebaseAI(backend: .vertexai(location: "LOCATION"))
// ...
Kotlin
// ...
// Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
// For the legacy `vertexAI` syntax, the default location is `us-central`, so
// specifying a location is usually required since most models are *not* supported in `us-central`.
val ai = Firebase.ai(backend = GenerativeBackend.vertexAI(location = "LOCATION"))
// ...
Java
// ...
// Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
// For the legacy `vertexAI` syntax, the default location is `us-central`, so
// specifying a location is usually required since most models are *not* supported in `us-central`.
GenerativeModel ai = FirebaseAI.getInstance(GenerativeBackend.vertexAI("LOCATION"));
// ...
Web
// ...
// Initialize FirebaseApp
// Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
// For the legacy `VertexAIBackend` syntax, the default location is `us-central`, so
// specifying a location is usually required since most models are *not* supported in `us-central`.
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-central`, so
// specifying a location is usually required since most models are *not* supported in `us-central`.
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-central`, so
// specifying a location is usually required since most models are *not* supported in `us-central`.
var ai = FirebaseAI.GetInstance(FirebaseAI.Backend.VertexAI(location: "LOCATION"));
// ...
Wenn Sie einen Standort angeben, an dem das Modell nicht verfügbar ist, wird ein 404-Fehler zurückgegeben, 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 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 (detaillierte Informationen zur Standortverfügbarkeit finden Sie in der Google Cloud Dokumentation).
Wichtige Hinweise:
Firebase AI Logic verwendet standardmäßig den Standort
us-central1.Für alle Gemini Vorschaumodelle (außer Live API Modelle) ist der einzige unterstützte Standort
global.Wenn Sie Firebase AI Logic verwenden, um auf Gemini 3.x Modelle zuzugreifen, ist der einzige unterstützte Standort
global. Firebase AI Logic unterstützt die Standorteusundeunoch nicht.Für alle Live API Modelle und alle Imagen Modelle wird der
globalStandort nicht unterstützt.
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)