mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-11 15:05:47 +00:00
docs: document milvus endpoints
This commit is contained in:
@@ -7,8 +7,10 @@ from litellm.llms.base_llm.vector_store.transformation import BaseVectorStoreCon
|
||||
from litellm.secret_managers.main import get_secret_str
|
||||
from litellm.types.router import GenericLiteLLMParams
|
||||
from litellm.types.vector_stores import (
|
||||
BaseVectorStoreAuthCredentials,
|
||||
VectorStoreCreateOptionalRequestParams,
|
||||
VectorStoreCreateResponse,
|
||||
VectorStoreIndexEndpoints,
|
||||
VectorStoreResultContent,
|
||||
VectorStoreSearchOptionalRequestParams,
|
||||
VectorStoreSearchResponse,
|
||||
@@ -63,6 +65,33 @@ class MilvusVectorStoreConfig(BaseVectorStoreConfig):
|
||||
|
||||
return headers
|
||||
|
||||
def get_auth_credentials(
|
||||
self, litellm_params: dict
|
||||
) -> BaseVectorStoreAuthCredentials:
|
||||
api_key = litellm_params.get("api_key")
|
||||
if not api_key:
|
||||
raise ValueError(
|
||||
"MILVUS_API_KEY is not set. Either set it in the litellm_params or set the MILVUS_API_KEY environment variable."
|
||||
)
|
||||
return {
|
||||
"headers": {
|
||||
"Authorization": f"Bearer {api_key}",
|
||||
},
|
||||
}
|
||||
|
||||
def get_vector_store_endpoints_by_type(self) -> VectorStoreIndexEndpoints:
|
||||
return {
|
||||
"read": [
|
||||
("POST", "/v2/vectordb/entities/search"),
|
||||
("POST", "/v2/vectordb/entities/get"),
|
||||
("POST", "/v2/vectordb/entities/query"),
|
||||
],
|
||||
"write": [
|
||||
("POST", "/v2/vectordb/entities/upsert"),
|
||||
("POST", "/v2/vectordb/entities/insert"),
|
||||
],
|
||||
}
|
||||
|
||||
def map_openai_params(
|
||||
self, non_default_params: dict, optional_params: dict, drop_params: bool
|
||||
) -> dict:
|
||||
|
||||
@@ -6,11 +6,19 @@ model_list:
|
||||
litellm_params:
|
||||
model: openai/text-embedding-3-large
|
||||
|
||||
general_settings:
|
||||
master_key: sk-1234
|
||||
pass_through_endpoints:
|
||||
- path: "/v1/my-custom-path" # Route on LiteLLM Proxy
|
||||
target: "http://0.0.0.0:8089/v1/my-custom-path" # Target endpoint
|
||||
headers: # Headers to forward
|
||||
Authorization: "bearer sk-1234"
|
||||
forward_headers: true # Forward all incoming headers
|
||||
vector_store_registry:
|
||||
- vector_store_name: "milvus-knowledgebase"
|
||||
litellm_params:
|
||||
vector_store_id: "my-collection-name"
|
||||
custom_llm_provider: "milvus"
|
||||
api_key: os.environ/MILVUS_API_KEY
|
||||
api_base: https://your-milvus-instance.milvus.io
|
||||
litellm_embedding_model: "azure/text-embedding-3-large"
|
||||
litellm_embedding_config:
|
||||
api_base: https://your-endpoint.cognitiveservices.azure.com/
|
||||
api_key: os.environ/AZURE_API_KEY
|
||||
api_version: "2025-09-01"
|
||||
milvus_text_field: "book_intro"
|
||||
# Optional Milvus parameters
|
||||
annsField: "book_intro_vector"
|
||||
limit: 10
|
||||
Reference in New Issue
Block a user