diff --git a/.env.example b/.env.example index 21c1030a..9217eb5d 100644 --- a/.env.example +++ b/.env.example @@ -12,6 +12,12 @@ LLM_BINDING=ollama LLM_BINDING_HOST=http://host.docker.internal:11434 LLM_MODEL=mistral-nemo:latest +# OpenAI alike example +# LLM_BINDING=openai +# LLM_BINDING_HOST=https://localhost:11434/api +# LLM_MODEL=deepseek-chat +# LLM_BINDING_API_KEY=your_api_key + # Lollms example # LLM_BINDING=lollms # LLM_BINDING_HOST=http://host.docker.internal:9600 diff --git a/lightrag/api/README.md b/lightrag/api/README.md index 545811e4..08b001d2 100644 --- a/lightrag/api/README.md +++ b/lightrag/api/README.md @@ -38,10 +38,9 @@ For example, you have the possibility to use ollama for the embedding and openai - Default connection: http://localhost:11434 - Configure using --ollama-host if running on a different host/port -#### For OpenAI Server +#### For OpenAI Alike Server - Requires valid OpenAI API credentials set in environment variables -- OPENAI_API_KEY must be set -- LLM_BINDING or LLM_MODEL must be set by command line on in environment variables +- LLM_BINDING, LLM_MODEL, LLM_BINDING_API_KEY must be set by command line on in environment variables #### For Azure OpenAI Server Azure OpenAI API can be created using the following commands in Azure CLI (you need to install Azure CLI first from [https://docs.microsoft.com/en-us/cli/azure/install-azure-cli](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)): diff --git a/lightrag/api/lightrag_server.py b/lightrag/api/lightrag_server.py index 21fc68ab..52881860 100644 --- a/lightrag/api/lightrag_server.py +++ b/lightrag/api/lightrag_server.py @@ -616,7 +616,7 @@ def create_app(args): system_prompt=system_prompt, history_messages=history_messages, base_url=args.llm_binding_host, - api_key=os.getenv("OPENAI_API_KEY"), + api_key=args.llm_binding_api_key, **kwargs, )