yangdx
commited on
Commit
·
bca7d26
1
Parent(s):
70091d3
Updated OpenAI configuration and documentation.
Browse files- Added OpenAI alike example in .env.example
- Updated README for OpenAI alike server
- Modified API key handling in lightrag_server.py
- .env.example +6 -0
- lightrag/api/README.md +2 -3
- lightrag/api/lightrag_server.py +1 -1
.env.example
CHANGED
@@ -12,6 +12,12 @@ LLM_BINDING=ollama
|
|
12 |
LLM_BINDING_HOST=http://host.docker.internal:11434
|
13 |
LLM_MODEL=mistral-nemo:latest
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
# Lollms example
|
16 |
# LLM_BINDING=lollms
|
17 |
# LLM_BINDING_HOST=http://host.docker.internal:9600
|
|
|
12 |
LLM_BINDING_HOST=http://host.docker.internal:11434
|
13 |
LLM_MODEL=mistral-nemo:latest
|
14 |
|
15 |
+
# OpenAI alike example
|
16 |
+
# LLM_BINDING=openai
|
17 |
+
# LLM_BINDING_HOST=https://localhost:11434/api
|
18 |
+
# LLM_MODEL=deepseek-chat
|
19 |
+
# LLM_BINDING_API_KEY=your_api_key
|
20 |
+
|
21 |
# Lollms example
|
22 |
# LLM_BINDING=lollms
|
23 |
# LLM_BINDING_HOST=http://host.docker.internal:9600
|
lightrag/api/README.md
CHANGED
@@ -38,10 +38,9 @@ For example, you have the possibility to use ollama for the embedding and openai
|
|
38 |
- Default connection: http://localhost:11434
|
39 |
- Configure using --ollama-host if running on a different host/port
|
40 |
|
41 |
-
#### For OpenAI Server
|
42 |
- Requires valid OpenAI API credentials set in environment variables
|
43 |
-
-
|
44 |
-
- LLM_BINDING or LLM_MODEL must be set by command line on in environment variables
|
45 |
|
46 |
#### For Azure OpenAI Server
|
47 |
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)):
|
|
|
38 |
- Default connection: http://localhost:11434
|
39 |
- Configure using --ollama-host if running on a different host/port
|
40 |
|
41 |
+
#### For OpenAI Alike Server
|
42 |
- Requires valid OpenAI API credentials set in environment variables
|
43 |
+
- LLM_BINDING, LLM_MODEL, LLM_BINDING_API_KEY must be set by command line on in environment variables
|
|
|
44 |
|
45 |
#### For Azure OpenAI Server
|
46 |
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)):
|
lightrag/api/lightrag_server.py
CHANGED
@@ -616,7 +616,7 @@ def create_app(args):
|
|
616 |
system_prompt=system_prompt,
|
617 |
history_messages=history_messages,
|
618 |
base_url=args.llm_binding_host,
|
619 |
-
api_key=
|
620 |
**kwargs,
|
621 |
)
|
622 |
|
|
|
616 |
system_prompt=system_prompt,
|
617 |
history_messages=history_messages,
|
618 |
base_url=args.llm_binding_host,
|
619 |
+
api_key=args.llm_binding_api_key,
|
620 |
**kwargs,
|
621 |
)
|
622 |
|