AI 프롬프트 압축 플러그인 OpenAPI 사양
AI 프롬프트 압축 플러그인 OpenAPI 사양 (AI Prompt Compressor Plugin OpenAPI Specification)
이 문서는 AI Prompt Compressor 플러그인과 함께 동작하는 AI Compress Server API의 OpenAPI 사양이에요. 요청 본문의 프롬프트를 압축해 주는 /llm/v1/compressPrompt 엔드포인트의 요청·응답 스키마를 정의하고 있어요. 압축 방식(rate, target_token)과 토큰 범위 같은 파라미터, 그리고 원본·압축 토큰 수 같은 압축 결과를 어떻게 주고받는지 확인할 수 있어요
출처: 문서
본문
---
openapi: 3.1.1
info:
title: AI Compress Server API
description: 'This spec describes the APIs that can work with AI Prompt Compressor
plugin to compress the prompt in the request body.
'
version: 1.0.0
paths:
"/llm/v1/compressPrompt":
post:
summary: Compress the prompt in the request body
description: Returns the compressed prompt and compression results.
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- text
- model_name
- compress_type
- compress_ranges
properties:
text:
type:
- array
- string
items:
type: object
required:
- msg_id
- text
properties:
msg_id:
type: integer
text:
type: string
compress_type:
type: string
enum:
- rate
- target_token
compress_ranges:
type: array
items:
type: object
properties:
min_tokens:
type: integer
max_tokens:
type: integer
value:
type: number
model_name:
type: string
advanced_logging:
type: boolean
default: false
responses:
'200':
description: Service is healthy
content:
application/json:
schema:
type: object
properties:
text:
type: array
items:
type: object
properties:
compress_prompt:
type: string
compressor_results:
type: object
properties:
msg_id:
type: integer
original_token_count:
type: integer
compress_token_count:
type: integer
save_token_count:
type: integer
compress_value:
type: number
compress_type:
type: string
enum:
- rate
- target_token
compressor_model:
type: string
original_text:
type: string
compress_text:
type: string
information:
type: string
msg_id:
type: integer
duration:
type: number
'400':
description: when error happens
content:
application/json:
schema:
type: object
properties:
error:
type: object
properties:
message:
type: string
"/status":
get:
summary: Health check
description: Returns the health status of the service.
responses:
'200':
description: Service is healthy
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: ok
model_name:
type: string
enum:
- microsoft/llmlingua-2-xlm-roberta-large-meetingbank
- microsoft/llmlingua-2-bert-base-multilingual-cased-meetingbank
device_map:
type: string
enum:
- cuda
- cpu
- mps
- balanced
- balanced_low_0
- auto
관련 리소스
더 알아보기 (Learn more)
- AI Compressor 플러그인으로 LLM 프롬프트 크기를 줄이는 실습 가이드예요 — Control prompt size with the AI Compressor plugin
- Kong AI Gateway의 전반적인 개념과 기능을 소개해요 — About AI Gateway
- AI Gateway에서 사용할 수 있는 모든 플러그인 목록을 확인할 수 있어요 — All AI Gateway plugins
- 프롬프트를 가공하는 관련 플러그인인 AI Prompt Decorator를 소개해요 — AI Prompt Decorator
- RAG 컨텍스트를 프롬프트에 주입하는 관련 플러그인 AI RAG Injector를 소개해요 — AI RAG Injector