|
לוחצים על הספק Gemini API כדי לראות בדף הזה תוכן וקוד שספציפיים לספק. |
מודלים גנרטיביים של AI מבית Google זמינים באזורים מסוימים. אתם יכולים לבחור איפה לגשת למודל בהתאם לקריטריונים של תאימות, זמן אחזור, זמינות ועמידות.
כשמשתמשים ב-Firebase AI Logic, כל בקשה שמשתמשת ב-Agent Platform Gemini API (formerly Vertex AI) יכולה לכלול את המיקום כדי לגשת למודל. Firebase AI Logic כוללת הגדרות מיקום שמוגדרות כברירת מחדל.
- כשמשתמשים בתחביר החדש של הפעלת Agent Platform:
global - כשמשתמשים בתחביר ההפעלה מדור קודם של Vertex AI:
us-central1
ברוב המודלים של Gemini, המודל Agent Platform Gemini API (formerly Vertex AI) תומך בglobal מיקום, כלומר הבקשה שלכם תטופל על ידי מודל זמין בכל מקום במאגר הגלובלי. שימוש במיקום global לבקשות יכול לעזור לכם להימנע מהגעה למגבלות הקיבולת של המודל ולצמצם את השגיאות מסוג 'השירות עמוס מדי' (503). בנוסף, בהתאם למודל, יכול להיות שתידרשו להשתמש במיקום global.
מתי צריך להגדיר מיקום באופן מפורש?
ל-Firebase AI Logic יש הגדרות ברירת מחדל אוטומטיות למיקום (לדוגמה,global כשמשתמשים בתחביר של הפעלת Agent Platform). עם זאת, אם אתם צריכים או רוצים להשתמש במיקום אחר, אתם צריכים לציין במפורש את המיקום במהלך האתחול של שירות לקצה העורפי Agent Platform Gemini API (formerly Vertex AI) בקוד.
בהתאם למודל, יכול להיות שנדרש להגדיר מיקום באופן מפורש.
אם הבקשה שלכם מנסה לגשת למודל במיקום שבו הוא לא זמין, תקבלו שגיאת 404 עם ההודעה שהמודל was not found or your project does not have access to it.
Gemini מודלים בגרסת Preview וניסיוניים: זמינים רק במיקום
global(למעט מודלים מסוג Live API – ראו בהמשך).מודלים של Gemini 3.x: זמינים רק במיקום
globalכשמשתמשים ב-Firebase AI Logic. Firebase AI Logic עדיין לא תומך במיקומיםusו-eu.Gemini 2.5 models: זמינים בהרבה מיקומים.
מודלים של Gemini Live API: זמינים רק במיקום
us-central1. אין תמיכה במיקוםglobal.
בהמשך הדף הזה מופיעה רשימה של כל המיקומים הזמינים.
עובדות כלליות ושיטות מומלצות
ריכזנו כאן כמה עובדות חשובות ושיטות מומלצות לגבי מיקומים:
מגבלות הקיבולת הן לכל מודל, לכל אזור ולכל דקה.
כדי להימנע מהגעה למגבלות הקיבולת באופן לא צפוי, כדאי להשתמש במיקום
global(אם המודל תומך במיקוםglobal).כדאי להשתמש בFirebase Remote Config כדי לשלוט במיקום שבו ניגשים למודל. כך תוכלו לשנות את המיקום בלי לפרסם גרסה חדשה של האפליקציה.
אם השימוש במיקום של
globalלא רלוונטי או לא נתמך בתרחיש השימוש שלכם, כדאי להפיץ באופן מפורש את המיקום שבו אתם ניגשים למודלים. לדוגמה, אפשר להגדיר את המיקום על סמך המיקום של משתמש הקצה באמצעות Firebase Remote Config.
דוגמאות קוד
ל-Firebase AI Logic יש הגדרות ברירת מחדל אוטומטיות למיקום (לדוגמה, global כשמשתמשים בתחביר של אתחול Agent Platform). עם זאת, אם אתם צריכים או רוצים להשתמש במיקום אחר, אתם צריכים לציין במפורש את המיקום במהלך האתחול של שירות לקצה העורפי Agent Platform Gemini API (formerly Vertex AI) בקוד.
מחליפים את LOCATION בקוד המיקום (לדוגמה, global או europe-west4) מתוך רשימת המיקומים הזמינים שבהמשך הדף.
התחביר של Agent Platform
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');
// ...
Unity
// ...
// 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
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');
// ...
Unity
// ...
// 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"));
// ...
שימו לב: אם תציינו מיקום שבו המודל לא זמין, תקבלו שגיאת 404 שבה מצוין שהמודל was not found or your project does not have access to it.
מיקומים זמינים
אפליקציית Google Cloud משתמשת באזורים. Google Cloud מאחסנת נתוני לקוחות רק באזור שאתם מציינים לכל התכונות הזמינות בדרך כלל של AI גנרטיבי ב-Agent Platform.
AI גנרטיבי ב-Agent Platform זמין באזורים הבאים. יכול להיות שדגמים מסוימים או גרסאות ספציפיות לא יהיו זמינים בכל המיקומים (מידע מפורט על זמינות לפי מיקום זמין במסמכי התיעוד של Google Cloud).
שימו לב לנקודות הבאות:
ברירת המחדל של Firebase AI Logic היא המיקום
us-central1.בכל המודלים Gemini בגרסת טרום-השקה (מלבד מודלים מסוג Live API), המיקום הנתמך היחיד הוא
global.כשמשתמשים ב-Firebase AI Logic כדי לגשת למודלים של Gemini 3.x, המיקום הנתמך היחיד הוא
global. Firebase AI Logic עדיין לא תומך במיקומיםusו-eu.בכל דגמי Live API ובכל דגמי Imagen, המיקום
globalלא נתמך.
גלובלי
global
ארצות הברית
- קולומבוס, אוהיו (
us-east5) - דאלאס, טקסס (
us-south1) - איווה (
us-central1) - לאס וגאס, נבאדה (
us-west4) - מונקס קורנר, קרוליינה הדרומית (
us-east1) - צפון וירג'יניה (
us-east4) - אורגון (
us-west1)
קנדה
- מונטריאול (
northamerica-northeast1)
דרום אמריקה
- סאו פאולו, ברזיל (
southamerica-east1)
אירופה
- בלגיה (
europe-west1) - פינלנד (
europe-north1) - פרנקפורט, גרמניה (
europe-west3) - לונדון, בריטניה (
europe-west2) - מדריד, ספרד (
europe-southwest1) - מילאנו, איטליה (
europe-west8) - הולנד (
europe-west4) - פריז, צרפת (
europe-west9) - ורשה, פולין (
europe-central2) - ציריך, שווייץ (
europe-west6)
אסיה ואזור האוקיינוס השקט
- מחוז צ'נגואה, טייוואן (
asia-east1) - הונג קונג, סין (
asia-east2) - מומבאי, הודו (
asia-south1) - סיאול, קוריאה (
asia-northeast3) - סינגפור (
asia-southeast1) - סידני, אוסטרליה (
australia-southeast1) - טוקיו, יפן (
asia-northeast1)
המזרח התיכון
- דמאם, ערב הסעודית (
me-central2) - דוחה, קטאר (
me-central1) - תל אביב, ישראל (
me-west1)