Conversation
매 분석 요청마다 동일하게 앞에 붙던 prompt.txt 지시문(~3.3K 토큰)을 별도 content 블록으로 분리하고 cache_control(ephemeral)을 적용. 2회차 요청부터 정적 프리픽스가 cache_read(약 0.1배 단가)로 처리되어 입력 토큰 비용을 절감. - 캐시 안정성을 위해 정적 프리픽스를 맨 앞에 고정하고, 가변 영역(계약서 본문 + 관련 판례)은 그 뒤로 재배치. (기존엔 RAG 컨텍스트가 맨 앞이라 캐시 불가) - 검색(retrieve) 쿼리는 기존과 동일한 전체 프롬프트를 사용해 검색 결과 불변. - 모델이 프롬프트 캐싱 미지원 시 cache_control 없이 자동 폴백(운영 안전장치). - usage(cache_read/cache_write) 로깅으로 캐시 적중 검증 가능. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
매 분석 요청마다 동일하게 앞에 붙던 prompt.txt 지시문(~3.3K 토큰)을 별도
content 블록으로 분리하고 cache_control(ephemeral)을 적용. 2회차 요청부터 정적 프리픽스가 cache_read(약 0.1배 단가)로 처리되어 입력 토큰 비용을 절감.