Gemini Enterprise Agent Platform 기반 Mistral AI 모델은 완전 관리형 서버리스 모델을 API로 제공합니다. Agent Platform에서 Mistral AI 모델을 사용하려면 요청을 Agent Platform API 엔드포인트로 직접 보냅니다. Mistral AI 모델은 관리형 API를 사용하므로 인프라를 프로비저닝하거나 관리할 필요가 없습니다.
대답을 스트리밍하여 최종 사용자의 지연 시간 인식을 줄일 수 있습니다. 스트리밍된 응답은 서버 전송 이벤트(SSE)를 사용하여 대답을 점진적으로 스트리밍합니다.
Mistral AI 모델은 사용한 만큼만 비용을 지불합니다(사용한 만큼만 지불). 사용한 만큼만 지불 가격 책정은 Gemini Enterprise Agent Platform 가격 책정 페이지의 Mistral AI 모델 가격 책정을 참고하세요.
사용 가능한 Mistral AI 모델
Mistral AI에서 Gemini Enterprise Agent Platform에 사용할 수 있는 다음 모델을 사용할 수 있습니다. Mistral AI 모델에 액세스하려면 Model Garden 모델 카드로 이동합니다.
Mistral AI 모델 사용
다음 모델 이름을 사용하여 curl 명령어로 Gemini Enterprise Agent Platform 엔드포인트에 요청을 보낼 수 있습니다.
- Mistral Medium 3의 경우
mistral-medium-3을 사용합니다. - Mistral OCR(25.05)의 경우
mistral-ocr-2505를 사용합니다. - Mistral Small 3.1(25.03)의 경우
mistral-small-2503을 사용합니다. - Codestral(25.01)의 경우
codestral-2를 사용합니다.
Mistral AI SDK 사용에 관한 자세한 내용은 Mistral AI Gemini Enterprise Agent Platform 문서를 참고하세요.
시작하기 전에
Gemini Enterprise Agent Platform에서 Mistral AI 모델을 사용하려면 다음 단계를 실행해야 합니다. Gemini Enterprise Agent Platform을 사용하려면 Agent Platform API(aiplatform.googleapis.com)를 사용 설정해야 합니다. Agent Platform API가 사용 설정된 기존 프로젝트가 이미 있는 경우 새 프로젝트를 만드는 대신 해당 프로젝트를 사용할 수 있습니다.
- Google Cloud 계정에 로그인합니다. Google Cloud를 처음 사용하는 경우 계정을 만들고 Google 제품의 실제 성능을 평가해 보세요. 신규 고객에게는 워크로드를 실행, 테스트, 배포하는 데 사용할 수 있는 $300의 무료 크레딧이 제공됩니다.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Gemini Enterprise Agent Platform API, if it is not already enabled.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Gemini Enterprise Agent Platform API, if it is not already enabled.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.- 다음 Model Garden 모델 카드 중 하나로 이동한 다음 사용 설정을 클릭합니다.
Mistral AI 모델에 스트리밍 호출 수행
다음 샘플은 Mistral AI 모델을 스트리밍 호출합니다.
REST
환경을 설정한 후 REST를 사용하여 텍스트 프롬프트를 테스트할 수 있습니다. 다음 샘플은 요청을 게시자 모델 엔드포인트에 전송합니다.
요청 데이터를 사용하기 전에 다음을 바꿉니다.
- LOCATION: Mistral AI 모델을 지원하는 리전
- MODEL: 사용할 모델 이름. 요청 본문에서
@모델 버전 번호를 제외합니다. - ROLE: 메시지와 연결된 역할.
user또는assistant를 지정할 수 있습니다. 첫 번째 메시지는user역할을 사용해야 합니다. 모델이user와assistant의 턴을 번갈아가며 작동합니다. 최종 메시지에서assistant역할을 사용하는 경우 이 메시지의 콘텐츠에서 곧바로 대답 콘텐츠가 계속됩니다. 이를 사용하여 모델 응답의 일부를 제한할 수 있습니다. - STREAM: 응답 스트리밍 여부를 지정하는 불리언. 응답을 스트리밍하여 최종 사용자 지연 시간 인식을 줄입니다. 응답을 스트리밍하려면
true로 설정하고 응답을 한 번에 반환하려면false로 설정합니다. - CONTENT:
user또는assistant메시지의 콘텐츠(예: 텍스트). - MAX_OUTPUT_TOKENS:
응답에서 생성될 수 있는 토큰의 최대 개수. 토큰은 약 3.5자(영문 기준)입니다. 토큰 100개는 단어 약 60~80개에 해당합니다.
응답이 짧을수록 낮은 값을 지정하고 잠재적으로 응답이 길면 높은 값을 지정합니다.
HTTP 메서드 및 URL:
POST https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/mistralai/models/MODEL:streamRawPredict
JSON 요청 본문:
{
"model": MODEL,
"messages": [
{
"role": "ROLE",
"content": "CONTENT"
}],
"max_tokens": MAX_TOKENS,
"stream": true
}
요청을 보내려면 다음 옵션 중 하나를 선택합니다.
curl
요청 본문을 request.json 파일에 저장하고 다음 명령어를 실행합니다.
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/mistralai/models/MODEL:streamRawPredict"
PowerShell
요청 본문을 request.json 파일에 저장하고 다음 명령어를 실행합니다.
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/mistralai/models/MODEL:streamRawPredict" | Select-Object -Expand Content
다음과 비슷한 JSON 응답이 수신됩니다.
Mistral AI 모델에 단항 호출 수행
다음 샘플은 Mistral AI 모델을 단항 호출합니다.
REST
환경을 설정한 후 REST를 사용하여 텍스트 프롬프트를 테스트할 수 있습니다. 다음 샘플은 요청을 게시자 모델 엔드포인트에 전송합니다.
요청 데이터를 사용하기 전에 다음을 바꿉니다.
- LOCATION: Mistral AI 모델을 지원하는 리전
- MODEL: 사용할 모델 이름. 요청 본문에서
@모델 버전 번호를 제외합니다. - ROLE: 메시지와 연결된 역할.
user또는assistant를 지정할 수 있습니다. 첫 번째 메시지는user역할을 사용해야 합니다. 모델이user와assistant의 턴을 번갈아가며 작동합니다. 최종 메시지에서assistant역할을 사용하는 경우 이 메시지의 콘텐츠에서 곧바로 대답 콘텐츠가 계속됩니다. 이를 사용하여 모델 응답의 일부를 제한할 수 있습니다. - STREAM: 응답 스트리밍 여부를 지정하는 불리언. 응답을 스트리밍하여 최종 사용자 지연 시간 인식을 줄입니다. 응답을 스트리밍하려면
true로 설정하고 응답을 한 번에 반환하려면false로 설정합니다. - CONTENT:
user또는assistant메시지의 콘텐츠(예: 텍스트). - MAX_OUTPUT_TOKENS:
응답에서 생성될 수 있는 토큰의 최대 개수. 토큰은 약 3.5자(영문 기준)입니다. 토큰 100개는 단어 약 60~80개에 해당합니다.
응답이 짧을수록 낮은 값을 지정하고 잠재적으로 응답이 길면 높은 값을 지정합니다.
HTTP 메서드 및 URL:
POST https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/mistralai/models/MODEL:rawPredict
JSON 요청 본문:
{
"model": MODEL,
"messages": [
{
"role": "ROLE",
"content": "CONTENT"
}],
"max_tokens": MAX_TOKENS,
"stream": false
}
요청을 보내려면 다음 옵션 중 하나를 선택합니다.
curl
요청 본문을 request.json 파일에 저장하고 다음 명령어를 실행합니다.
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/mistralai/models/MODEL:rawPredict"
PowerShell
요청 본문을 request.json 파일에 저장하고 다음 명령어를 실행합니다.
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/mistralai/models/MODEL:rawPredict" | Select-Object -Expand Content
다음과 비슷한 JSON 응답이 수신됩니다.
Mistral AI 모델 리전 가용성 및 할당량
Mistral AI 모델의 경우 모델을 사용할 수 있는 각 리전에 할당량이 적용됩니다. 할당량은 분당 쿼리 수(QPM) 및 분당 토큰 수(TPM)로 지정됩니다. TPM에는 입력 및 출력 토큰이 모두 포함됩니다.
| 모델 | 지역 | 할당량 | 컨텍스트 길이 |
|---|---|---|---|
| Mistral Medium 3 | |||
us-central1 |
|
128,000 | |
europe-west4 |
|
128,000 | |
| Mistral OCR(25.05) | |||
us-central1 |
|
30페이지 | |
europe-west4 |
|
30페이지 | |
| Mistral Small 3.1(25.03) | |||
us-central1 |
|
128,000 | |
europe-west4 |
|
128,000 | |
| Codestral 2 | |||
us-central1 |
|
토큰 128,000개 | |
europe-west4 |
|
토큰 128,000개 |
Agent Platform의 할당량을 늘리려면 Google Cloud 콘솔을 사용하여 할당량 증가를 요청하면 됩니다. 할당량에 대한 자세한 내용은 Cloud 할당량 개요를 참고하세요.