|
Gemini API 제공업체를 클릭하여 이 페이지에서 제공업체별 콘텐츠와 코드를 확인합니다. |
Google의 생성형 AI 모델은 특정 리전에서 사용할 수 있습니다.
코드에서 Vertex AI Gemini API 백엔드 서비스를 초기화할 때 요청에서 액세스하는 모델의 위치를 선택적으로 지정할 수 있습니다. 이 페이지 뒷부분의 사용 가능한 위치 목록을 참고하세요.
다음은 위치에 관한 주요 사실과 권장사항입니다.
용량 한도는 모델별, 리전별, 분별로 적용됩니다.
위치를 지정하지 않으면 기본값은
us-central1입니다.예상치 못한 용량 한도에 도달하지 않으려면 요청에서 위치를
global로 설정하는 것이 좋습니다.사용 사례에
global로 위치를 설정하는 것이 적합하지 않다면 모델에 액세스하는 위치를 명시적으로 분산하는 것이 좋습니다. 예를 들어 Firebase Remote Config를 사용하여 최종 사용자의 위치에 따라 위치를 설정할 수 있습니다.
global 위치에 대해 알아보기
거의 모든 Gemini 모델에 액세스하기 위해 Vertex AI Gemini API는 global 위치를 지원합니다. 즉, 전역 풀의 어느 곳에서나 사용 가능한 모델이 요청을 처리합니다.
요청의 위치를 global로 설정하면 모델의 용량 한도에 도달하는 것을 방지하고 리소스 부족 (429) 오류를 줄일 수 있습니다.
global 위치를 지정해야 합니다 (아래 코드 샘플 참고).Imagen 모델의 경우
global 위치가 지원되지 않습니다.
코드 샘플
이러한 샘플에서는 Gemini 모델에 액세스하는 방법을 보여주지만 Imagen 모델에 액세스할 때 위치를 지정할 수도 있습니다.
LOCATION을 이 페이지의 사용 가능한 위치 목록에 있는 위치 코드 (예: europe-west4)로 바꿉니다.
Swift
// ...
// Initialize the Vertex AI Gemini API backend service
// Specify the 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 the 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 the 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 the 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 the 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');
// ...
Unity
// ...
// Initialize the Vertex AI Gemini API backend service
// Specify the 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");
// ...
모델을 사용할 수 없는 위치를 지정하면 모델 was not found or your project does not have access to it가 표시되는 404 오류가 발생합니다.
사용 가능한 위치
Google Cloud는 리전을 사용합니다. Google Cloud는 Vertex AI의 생성형 AI의 모든 정식 버전에 대해 지정하는 리전에만 고객 데이터를 저장합니다.
Vertex AI의 생성형 AI는 다음 리전에서 사용할 수 있습니다. 일부 모델 또는 특정 버전은 일부 지역에서 제공되지 않을 수 있습니다 (자세한 지역별 제공 여부는 Google Cloud 문서를 참고하세요).
모든 Gemini 모델 (Gemini Live 모델 제외)은 global 위치에서도 사용할 수 있습니다. Imagen 모델의 경우 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)