You can integrate and use models deployed on GPUStack with any application or framework that supports the OpenAI-compatible API, simply by pointing it to GPUStack's OpenAI-compatible endpoint.
In the context of Retrieval-Augmented Generation (RAG), reranking refers to the process of selecting the most relevant information from retrieved documents or knowledge sources before presenting them to the user or utilizing them for answer generation.
Note that the OpenAI-compatible APIs do not provide a rerank endpoint. To fill this gap, GPUStack provides a Jina-compatible Rerank API at the /v1/rerank path.
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}}
Other APIs
For other API types, GPUStack allows you to enable the Generic Proxy feature when deploying a model.
Once enabled, there are two ways to address the target model:
Path-based form (recommended) — encode the model route id directly in the URL as /model/proxy/<model_route_id>/<upstream-path>. No extra header is required:
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..."]}'
Header-based form (deprecated) — send to /model/proxy/<upstream-path> and specify the target model via the X-GPUStack-Model header or the model field in the JSON body:
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..."]}'
The header-based form is retained for backward compatibility and will be removed in a future release; new integrations should use the path-based form.