Mistral AI 모델

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 Medium 3 고급 추론, 프로그래밍, 긴 컨텍스트 문서 이해, 단일 노드 높은 처리량, Agentic Workflows를 위해 설계된 다목적 멀티모달 모델입니다.
Mistral OCR (25.05) 풍부한 문서 이해를 위한 광학 문자 인식 API로, 멀티모달 RAG 파이프라인을 위해 인터리브 처리 이미지, 표, 그래프, LaTeX 형식을 추출합니다.
Mistral Small 3.1 (25.03) 128,000 토큰 컨텍스트 윈도우를 갖춘 다재다능하고 지연 시간이 짧은 멀티모달 모델로, 효율적인 채팅, 프로그래밍, 지침 준수에 최적화되어 있습니다.
Codestral 2 고정밀 fill-in-the-middle (FIM) 완성, 코드 검토, 리팩터링, 개발자 도구를 위해 빌드된 전문 코드 생성 모델입니다.

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가 사용 설정된 기존 프로젝트가 이미 있는 경우 새 프로젝트를 만드는 대신 해당 프로젝트를 사용할 수 있습니다.

  1. Google Cloud 계정에 로그인합니다. Google Cloud를 처음 사용하는 경우 계정을 만들고 Google 제품의 실제 성능을 평가해 보세요. 신규 고객에게는 워크로드를 실행, 테스트, 배포하는 데 사용할 수 있는 $300의 무료 크레딧이 제공됩니다.
  2. 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 the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. 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.enable permission. 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.

    Enable the API

  5. 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 the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  6. Verify that billing is enabled for your Google Cloud project.

  7. 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.enable permission. 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.

    Enable the API

  8. 다음 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
  • QPM: 90개
  • TPM: 315,000개
128,000
europe-west4
  • QPM: 90개
  • TPM: 315,000개
128,000
Mistral OCR(25.05)
us-central1
  • QPM: 30개
  • 요청당 페이지 수: 30페이지(1페이지 = 입력 토큰 1백만 개 및 출력 토큰 1백만 개)
30페이지
europe-west4
  • QPM: 30개
  • 요청당 페이지 수: 30페이지(1페이지 = 입력 토큰 1백만 개 및 출력 토큰 1백만 개)
30페이지
Mistral Small 3.1(25.03)
us-central1
  • QPM: 60개
  • TPM: 200,000개
128,000
europe-west4
  • QPM: 60개
  • TPM: 200,000개
128,000
Codestral 2
us-central1
  • QPM: 1,100개
  • 입력 TPM: 1,100,000개
  • 출력 TPM: 110,000개
토큰 128,000개
europe-west4
  • QPM: 1,100개
  • 입력 TPM: 1,100,000개
  • 출력 TPM: 110,000개
토큰 128,000개

Agent Platform의 할당량을 늘리려면 Google Cloud 콘솔을 사용하여 할당량 증가를 요청하면 됩니다. 할당량에 대한 자세한 내용은 Cloud 할당량 개요를 참고하세요.