모델에 액세스할 위치 지정

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


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

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

Firebase AI LogicVertex AI의 전역 위치를 아직 지원하지 않습니다.

코드 샘플

이 샘플에서는 Gemini 모델에 액세스하는 것을 보여 주지만 Imagen 3 모델에 액세스할 때 위치를 지정할 수도 있습니다.

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: '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 문서 참고).

미국

  • 오하이오주 콜럼버스(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)