Google의 생성형 AI 모델은 특정 지역 엔드포인트를 사용하여 노출됩니다.
Vertex AI 서비스를 초기화할 때 요청에서 액세스하는 모델의 엔드포인트 위치를 선택적으로 지정할 수 있습니다. 위치를 지정하지 않으면 기본값은 us-central1
입니다. 이 페이지 뒷부분의 사용 가능한 위치 목록을 참고하세요.
Vertex AI in Firebase는 Vertex AI의 전역 엔드포인트를 아직 지원하지 않습니다.
코드 샘플
이 샘플에서는 Gemini 모델에 액세스하는 것을 보여 주지만 Imagen 3 모델에 액세스할 때 위치를 지정할 수도 있습니다.
LOCATION을 이 페이지 뒷부분의 사용 가능한 위치 목록에 있는 위치 코드 (예: europe-west4
)로 바꿉니다.
Swift
import FirebaseVertexAI
// Initialize the Vertex AI service
// Specify the endpoint location for the model accessed by your requests
let vertex = VertexAI.vertexAI(location: "LOCATION")
// Create a `GenerativeModel` instance with a model that supports your use case
let model = vertex.generativeModel(modelName: "MODEL_NAME")
Kotlin
// Initialize the Vertex AI service
// Specify the endpoint location for the model accessed by your requests
val vertexAI = Firebase.vertexAI(location = "LOCATION")
// Create a `GenerativeModel` instance with a model that supports your use case
val generativeModel = vertexAI.generativeModel(modelName = "MODEL_NAME")
Java
// Initialize the Vertex AI service
// Specify the endpoint location for the model accessed by your requests
FirebaseVertexAI vertexAI = FirebaseVertexAI.getInstance("LOCATION");
// Create a `GenerativeModel` instance with a model that supports your use case
GenerativeModel gm = vertexAI.generativeModel("MODEL_NAME");
// Use the `GenerativeModelFutures` Java compatibility layer which offers
// support for `ListenableFuture` and Publisher APIs
GenerativeModelFutures model = GenerativeModelFutures.from(gm);
Web
import { initializeApp } from "firebase/app";
import { getVertexAI, getGenerativeModel } from "firebase/vertexai";
// TODO(developer) Replace the following with your app's Firebase configuration
// See: https://firebase.google.com/docs/web/learn-more#config-object
const firebaseConfig = {
// ...
};
// Initialize FirebaseApp
const firebaseApp = initializeApp(firebaseConfig);
// Initialize the Vertex AI service
// Specify the endpoint location for the model accessed by your requests
const vertexAI = getVertexAI(firebaseApp, { location: 'LOCATION' });
// Create a `GenerativeModel` instance with a model that supports your use case
const model = getGenerativeModel(vertexAI, { model: 'MODEL_NAME' });
Dart
import 'package:firebase_vertexai/firebase_vertexai.dart';
import 'package:firebase_core/firebase_core.dart';
// Initialize FirebaseApp
await Firebase.initializeApp();
// Initialize the Vertex AI service
// Specify the endpoint location for the model accessed by your requests
final vertexAI = await FirebaseVertexAI.instanceFor(location: 'LOCATION');
// Create a `GenerativeModel` instance with a model that supports your use case
final model = vertexAI.generativeModel(model: 'MODEL_NAME');
사용 가능한 위치
Google Cloud는 리전을 사용하여 리전 엔드포인트를 정의합니다. Google Cloud는 Vertex AI의 생성형 AI의 모든 정식 버전에 대해 지정하는 리전에만 고객 데이터를 저장합니다.
Vertex AI의 생성형 AI는 다음 리전에서 사용할 수 있습니다. 일부 모델 또는 특정 버전은 일부 위치에서 제공되지 않을 수 있습니다(자세한 위치별 사용 가능 여부는 Google Cloud 문서 참고).
미국
- 오하이오주 콜럼버스(
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
)