exportGPUSTACK_API_KEY=your_api_key
curlhttp://your_gpustack_server_url/v1/rerank\-H"Content-Type: application/json"\-H"Authorization: Bearer $GPUSTACK_API_KEY"\-d'{ "model": "bge-reranker-v2-m3", "query": "What is a panda?", "top_n": 3, "documents": [ "hi", "it is a bear", "The giant panda (Ailuropoda melanoleuca), sometimes called a panda bear or simply panda, is a bear species endemic to China." ] }'|jq
{"model":"bge-reranker-v2-m3","object":"list","results":[{"document":{"text":"The giant panda (Ailuropoda melanoleuca), sometimes called a panda bear or simply panda, is a bear species endemic to China."},"index":2,"relevance_score":1.951932668685913},{"document":{"text":"it is a bear"},"index":1,"relevance_score":-3.7347371578216553},{"document":{"text":"hi"},"index":0,"relevance_score":-6.157620906829834}],"usage":{"prompt_tokens":69,"total_tokens":69}}
System One 决策 API
决策模型——decision 类别的部署——遵循 System One(Jev)决策契约,而非生成文本:给定一个 state 和一组 questions,它们返回类型化的答案而非补全。GPUStack 在 /v1/systemone 路径上提供该契约。
model 字段必填,取模型路由名称,与 /v1/chat/completions 完全一致。GPUStack 解析模型后,将请求体其余部分和整个响应原样透传给决策引擎。
exportGPUSTACK_API_KEY=your_api_key
# Assume the model route id is 42.curlhttp://your_gpustack_server_url/model/proxy/42/embed\-XPOST\-H"Content-Type: application/json"\-H"Authorization: Bearer $GPUSTACK_API_KEY"\-d'{"inputs": ["What is Deep Learning?", "Deep Learning is not..."]}'
请求头方式(已弃用):请求 /model/proxy/<upstream-path>,通过 X-GPUStack-Model 请求头或 JSON 请求体中的 model 字段指定目标模型:
curlhttp://your_gpustack_server_url/model/proxy/embed\-XPOST\-H"Content-Type: application/json"\-H"Authorization: Bearer $GPUSTACK_API_KEY"\-H"X-GPUStack-Model: bge-m3"\-d'{"inputs": ["What is Deep Learning?", "Deep Learning is not..."]}'