044. Amazon Titan Text 모델 (Amazon Titan Text models)
- 원문: English
- 위치: References/Advanced › Advanced inference topics › Inference parameters › Amazon Titan models › Amazon Titan Text models
한 줄 요약
Titan Text(Lite/Express/Premier)는 inputText + 선택적 textGenerationConfig로 요청하고, 응답은 results[]의 outputText와 completionReason으로 받습니다.
핵심 내용
요청 형식 (InvokeModel의 body)
{
"inputText": "User: <프롬프트>\nBot:",
"textGenerationConfig": {
"temperature": 0.7,
"topP": 0.9,
"maxTokenCount": 512,
"stopSequences": []
}
}
inputText(필수): 대화형 응답을 원하면 "User: ...\nBot:" 형식을 쓰면 모델이 새 줄에 답합니다.textGenerationConfig는 선택입니다.
추론 파라미터
| 파라미터 | 기본값 | 범위 | 설명 |
|---|
temperature | 0.7 | 0.0 ~ 1.0 | 낮을수록 무작위성 감소 |
topP | 0.9 | 0 초과 ~ 1.0 | ⚠️ 0은 불가. 아주 작은 값(예: 0.0001) 사용 |
maxTokenCount | 512 | 모델별 (아래) | 최대 생성 토큰 수. 엄격히 적용 |
stopSequences | — | — | 생성을 멈출 문자열 |
| 모델 | maxTokenCount 최대 | 모델 ID (예제 기준) |
|---|
| Titan Text Lite | 4,096 | amazon.titan-text-lite-v1 |
| Titan Text Express | 8,192 | amazon.titan-text-express-v1 |
| Titan Text Premier | 3,072 | amazon.titan-text-premier-v1:0 |
응답
| 필드 | 설명 |
|---|
inputTextTokenCount | 프롬프트 토큰 수 |
results[].tokenCount | 응답 토큰 수 (results는 항목 1개 배열) |
results[].outputText | 응답 텍스트 |
results[].completionReason | 종료 이유 |
- 스트리밍(
InvokeModelWithResponseStream)은 chunk.bytes를 디코딩하면 index, inputTextTokenCount, totalOutputTextTokenCount, outputText, completionReason이 나옵니다.
completionReason | 의미 |
|---|
FINISHED | 완전히 생성됨 |
LENGTH | 설정한 길이로 잘림 |
STOP_CRITERIA_MET | 중지 조건 도달로 잘림 |
RAG_QUERY_WHEN_RAG_DISABLED | 기능이 비활성화되어 쿼리 완료 불가 |
CONTENT_FILTERED | 콘텐츠 필터가 내용을 필터링·제거 |
코드 예제
| 예제 | 모델 | 설정 |
|---|
| 회의록 → 담당자별 액션 아이템 | Titan Text Premier | maxTokenCount 3072, temperature 0.7, topP 0.9 |
| 같은 작업 | Titan Text G1 - Express | maxTokenCount 4096, temperature 0, topP 1 |
SA 관점
- 응답의
completionReason을 로깅하면 LENGTH(토큰 한도 부족)와 CONTENT_FILTERED(필터링) 문제를 쉽게 구분할 수 있습니다. - Titan Text는 세대가 오래된 모델이므로 신규 설계에서는 모델 수명 주기(Legacy/EOL)를 먼저 확인하세요. → 008