모델에 액세스할 위치 지정

Gemini API 제공업체를 클릭하여 이 페이지에서 제공업체별 콘텐츠와 코드를 확인합니다.


Google의 생성형 AI 모델은 특정 리전에서 사용할 수 있습니다.

코드에서 Vertex AI Gemini API 백엔드 서비스를 초기화할 때 요청에서 액세스하는 모델의 위치를 선택적으로 지정할 수 있습니다. 위치를 지정하지 않으면 기본값은 us-central1입니다. 이 페이지 뒷부분의 사용 가능한 위치 목록을 참고하세요.

global 위치 알아보기

Gemini 2.0Gemini 2.5 모델에 액세스하는 경우 Vertex AI Gemini APIglobal 위치를 지원하므로 전역 풀의 사용 가능한 모델이 요청을 처리합니다. 요청의 위치를 global로 설정하면 리소스 소진 (429) 오류를 줄이면서 전반적인 가용성을 개선할 수 있습니다.

또한 2025년 6월 이후에 출시된 Gemini 2.5 미리보기실험 모델은 일반적으로 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");

// ...

사용 가능한 위치

Google Cloud지역을 사용합니다. Google CloudVertex AI의 생성형 AI의 모든 정식 버전에 대해 지정하는 리전에만 고객 데이터를 저장합니다.

Vertex AI의 생성형 AI는 다음 리전에서 사용할 수 있습니다. 일부 모델 또는 특정 버전은 일부 지역에서 제공되지 않을 수 있습니다 (자세한 지역별 제공 여부는 Google Cloud 문서를 참고하세요).

Gemini 2.0Gemini 2.5 모델 (Gemini 2.0 Flash 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)