2.9. 유추 끝점
이 예제에서는 유추 끝점을 사용하여 모델을 쿼리하는 방법을 보여줍니다.
모델을 배포할 때 토큰 인증을 활성화한 경우 Authorization
헤더를 추가하고 토큰 값을 지정합니다.
2.9.1. KServe를 위한 Cainitiatort TGIS ServingRuntime 링크 복사링크가 클립보드에 복사되었습니다!
-
:443/api/v1/task/text-generation
-
:443/api/v1/task/server-streaming-text-generation
명령 예
curl --json '{"model_id": "<model_name__>", "inputs": "<text>"}' https://<inference_endpoint_url>:443/api/v1/task/server-streaming-text-generation -H 'Authorization: Bearer <token>'
curl --json '{"model_id": "<model_name__>", "inputs": "<text>"}' https://<inference_endpoint_url>:443/api/v1/task/server-streaming-text-generation -H 'Authorization: Bearer <token>'
2.9.2. KServe 용 카피네트 Standalone ServingRuntime 링크 복사링크가 클립보드에 복사되었습니다!
여러 모델을 제공하는 경우 /info/models
또는 :443 cactlplanet.runtime.info.InfoService/GetModelsInfo
를 쿼리하여 제공된 모델 목록을 볼 수 있습니다.
REST 끝점
-
/api/v1/task/embedding
-
/api/v1/task/embedding-tasks
-
/api/v1/task/sentence-similarity
-
/api/v1/task/sentence-similarity-tasks
-
/api/v1/task/rerank
-
/api/v1/task/rerank-tasks
-
/info/models
-
/info/version
-
/info/runtime
gRPC endpoints
-
:443 caikit.runtime.Nlp.NlpService/EmbeddingTaskPredict
-
:443 caikit.runtime.Nlp.NlpService/EmbeddingTasksPredict
-
:443 caikit.runtime.Nlp.NlpService/SentenceSimilarityTaskPredict
-
:443 caikit.runtime.Nlp.NlpService/SentenceSimilarityTasksPredict
-
:443 caikit.runtime.Nlp.NlpService/RerankTaskPredict
-
:443 caikit.runtime.Nlp.NlpService/RerankTasksPredict
-
:443 caikit.runtime.info.InfoService/GetModelsInfo
-
:443 caikit.runtime.info.InfoService/GetRuntimeInfo
기본적으로 Cakeygent Standalone Runtime은 REST 엔드포인트를 노출합니다. gRPC 프로토콜을 사용하려면 사용자 정의 Cakeygent Standalone ServingRuntime을 수동으로 배포합니다. 자세한 내용은 단일 모델 제공 플랫폼의 사용자 지정 모델 서비스 런타임 추가를 참조하십시오.
예제 매니페스트는 canit -tgis-serving GitHub 리포지토리에서 사용할 수 있습니다.
REST
curl -H 'Content-Type: application/json' -d '{"inputs": "<text>", "model_id": "<model_id>"}' <inference_endpoint_url>/api/v1/task/embedding -H 'Authorization: Bearer <token>'
curl -H 'Content-Type: application/json' -d '{"inputs": "<text>", "model_id": "<model_id>"}' <inference_endpoint_url>/api/v1/task/embedding -H 'Authorization: Bearer <token>'
gRPC
grpcurl -d '{"text": "<text>"}' -H \"mm-model-id: <model_id>\" <inference_endpoint_url>:443 caikit.runtime.Nlp.NlpService/EmbeddingTaskPredict -H 'Authorization: Bearer <token>'
grpcurl -d '{"text": "<text>"}' -H \"mm-model-id: <model_id>\" <inference_endpoint_url>:443 caikit.runtime.Nlp.NlpService/EmbeddingTaskPredict -H 'Authorization: Bearer <token>'
2.9.3. KServe 용 TGIS Standalone ServingRuntime 링크 복사링크가 클립보드에 복사되었습니다!
KServe의 text Generation Inference Server (TGIS) Standalone ServingRuntime 은 더 이상 사용되지 않습니다. 자세한 내용은 OpenShift AI 릴리스 노트를 참조하십시오.
-
:443 fmaas.GenerationService/Generate
:443 fmaas.GenerationService/GenerateStream
참고TGIS 독립 실행형 런타임의 끝점을 쿼리하려면 OpenShift AI
텍스트 생성
유추 리포지토리의 proto 디렉터리에 파일을 다운로드해야 합니다.
명령 예
grpcurl -proto text-generation-inference/proto/generation.proto -d '{"requests": [{"text":"<text>"}]}' -H 'Authorization: Bearer <token>' -insecure <inference_endpoint_url>:443 fmaas.GenerationService/Generate
grpcurl -proto text-generation-inference/proto/generation.proto -d '{"requests": [{"text":"<text>"}]}' -H 'Authorization: Bearer <token>' -insecure <inference_endpoint_url>:443 fmaas.GenerationService/Generate
2.9.4. OpenVino Model Server 링크 복사링크가 클립보드에 복사되었습니다!
-
/v2/models/<model-name>/infer
명령 예
curl -ks <inference_endpoint_url>/v2/models/<model_name>/infer -d '{ "model_name": "<model_name>", "inputs": [{ "name": "<name_of_model_input>", "shape": [<shape>], "datatype": "<data_type>", "data": [<data>] }]}' -H 'Authorization: Bearer <token>'
curl -ks <inference_endpoint_url>/v2/models/<model_name>/infer -d '{ "model_name": "<model_name>", "inputs": [{ "name": "<name_of_model_input>", "shape": [<shape>], "datatype": "<data_type>", "data": [<data>] }]}' -H 'Authorization: Bearer <token>'
2.9.5. vLLM NVIDIA GPU ServingRuntime for KServe 링크 복사링크가 클립보드에 복사되었습니다!
-
:443/version
-
:443/docs
-
:443/v1/models
-
:443/v1/chat/completions
-
:443/v1/completions
-
:443/v1/embeddings
-
:443/tokenize
:443/detokenize
참고- vLLM 런타임은 OpenAI REST API와 호환됩니다. vLLM 런타임에서 지원하는 모델 목록은 지원되는 모델을 참조하십시오.
- vLLM에 삽입된 유추 엔드포인트를 사용하려면 vLLM에서 지원하는 포함 모델을 사용해야 합니다. 유전 모델에는 임베딩 끝점을 사용할 수 없습니다. 자세한 내용은 vLLM의 포함 모델 지원을 참조하십시오.
vLLM v0.5.5부터
/v1/chat/completions
엔드포인트를 사용하여 모델을 쿼리하는 동안 채팅 템플릿을 제공해야 합니다. 모델에 사전 정의된 채팅 템플릿이 포함되어 있지 않은 경우 example과 같이chat-template
명령줄 매개 변수를 사용하여 사용자 지정 vLLM 런타임에 채팅 템플릿을 지정할 수 있습니다. <CHAT_TEMPLATE
>를 템플릿 경로로 바꿉니다.containers: - args: - --chat-template=<CHAT_TEMPLATE>
containers: - args: - --chat-template=<CHAT_TEMPLATE>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 여기에서 또는
/app/data/template
아래의 vLLM 이미지로 사용할 수 있는 채팅 템플릿을 사용할 수 있습니다.
표시된 경로에 표시된 대로 단일 모델 제공 플랫폼은 OpenShift 라우터의 HTTPS 포트(일반적으로 포트 443)를 사용하여 외부 API 요청을 처리합니다.
명령 예
curl -v https://<inference_endpoint_url>:443/v1/chat/completions -H "Content-Type: application/json" -d '{ "messages": [{ "role": "<role>", "content": "<content>" }] -H 'Authorization: Bearer <token>'
curl -v https://<inference_endpoint_url>:443/v1/chat/completions -H "Content-Type: application/json" -d '{ "messages": [{ "role": "<role>", "content": "<content>" }] -H 'Authorization: Bearer <token>'
2.9.6. KServe 용 vLLM Intel Gaudi Accelerator ServingRuntime 링크 복사링크가 클립보드에 복사되었습니다!
2.9.7. KServe용 vLLM AMD GPU ServingRuntime 링크 복사링크가 클립보드에 복사되었습니다!
2.9.8. NVIDIA Triton Inference Server 링크 복사링크가 클립보드에 복사되었습니다!
REST 끝점
-
v2/models/[/versions/<model_version>]/infer
-
v2/models/<model_name>[/versions/<model_version>]
-
v2/health/ready
-
v2/health/live
-
v2/models/<model_name>[/versions/]/ready
-
v2
ModelMesh는 다음 REST 끝점을 지원하지 않습니다.
-
v2/health/live
-
v2/health/ready
-
v2/models/<model_name>[/versions/]/ready
명령 예
curl -ks <inference_endpoint_url>/v2/models/<model_name>/infer -d '{ "model_name": "<model_name>", "inputs": [{ "name": "<name_of_model_input>", "shape": [<shape>], "datatype": "<data_type>", "data": [<data>] }]}' -H 'Authorization: Bearer <token>'
curl -ks <inference_endpoint_url>/v2/models/<model_name>/infer -d '{ "model_name": "<model_name>", "inputs": [{ "name": "<name_of_model_input>", "shape": [<shape>], "datatype": "<data_type>", "data": [<data>] }]}' -H 'Authorization: Bearer <token>'
gRPC endpoints
-
:443 inference.GRPCInferenceService/ModelInfer
-
:443 inference.GRPCInferenceService/ModelReady
-
:443 inference.GRPCInferenceService/ModelMetadata
-
:443 inference.GRPCInferenceService/ServerReady
-
:443 inference.GRPCInferenceService/ServerLive
-
:443 inference.GRPCInferenceService/ServerMetadata
명령 예
grpcurl -cacert ./openshift_ca_istio_knative.crt -proto ./grpc_predict_v2.proto -d @ -H "Authorization: Bearer <token>" <inference_endpoint_url>:443 inference.GRPCInferenceService/ModelMetadata
grpcurl -cacert ./openshift_ca_istio_knative.crt -proto ./grpc_predict_v2.proto -d @ -H "Authorization: Bearer <token>" <inference_endpoint_url>:443 inference.GRPCInferenceService/ModelMetadata