rag
Rag Query
RAG Query endpoint - search vector store, optionally rerank, and generate LLM response.
This endpoint:
- Extracts the query from the last user message
- Searches the vector store for relevant context
- Optionally reranks the results
- Generates an LLM response with the retrieved context
Example Request:
curl -X POST "http://localhost:4000/v1/rag/query" \
-H "Authorization: Bearer sk-1234" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "What is LiteLLM?"}],
"retrieval_config": {
"vector_store_id": "vs_abc123",
"custom_llm_provider": "openai",
"top_k": 5
}
}'
With Reranking:
curl -X POST "http://localhost:4000/v1/rag/query" \
-H "Authorization: Bearer sk-1234" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "What is LiteLLM?"}],
"retrieval_config": {
"vector_store_id": "vs_abc123",
"custom_llm_provider": "openai",
"top_k": 10
},
"rerank": {
"enabled": true,
"model": "cohere/rerank-english-v3.0",
"top_n": 3
}
}'
post/rag/query
Request
- Base URL: https://apiclaw.biz (the document declares no server; this is the origin it was published from)
- URL: https://apiclaw.biz/rag/query
- Auth: API key in header x-litellm-api-key
Response
Successful Response
unknown required
Changes
No recorded changes to this operation across all 1 revision of this API.