Enhanced documentation
Browse files- lightrag/api/README.md +61 -2
lightrag/api/README.md
CHANGED
@@ -61,10 +61,69 @@ az cognitiveservices account keys list --name $RESOURCE_NAME -g $RESOURCE_GROUP_
|
|
61 |
The output of the last command will give you the endpoint and the key for the OpenAI API. You can use these values to set the environment variables in the `.env` file.
|
62 |
|
63 |
|
|
|
64 |
|
65 |
-
|
66 |
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
#### LightRag Server Options
|
70 |
|
|
|
61 |
The output of the last command will give you the endpoint and the key for the OpenAI API. You can use these values to set the environment variables in the `.env` file.
|
62 |
|
63 |
|
64 |
+
## Configuration
|
65 |
|
66 |
+
LightRAG can be configured using either command-line arguments or environment variables. When both are provided, command-line arguments take precedence over environment variables.
|
67 |
|
68 |
+
### Environment Variables
|
69 |
+
|
70 |
+
You can configure LightRAG using environment variables by creating a `.env` file in your project root directory. Here's a complete example of available environment variables:
|
71 |
+
|
72 |
+
```env
|
73 |
+
# Server Configuration
|
74 |
+
HOST=0.0.0.0
|
75 |
+
PORT=9621
|
76 |
+
|
77 |
+
# Directory Configuration
|
78 |
+
WORKING_DIR=/app/data/rag_storage
|
79 |
+
INPUT_DIR=/app/data/inputs
|
80 |
+
|
81 |
+
# LLM Configuration
|
82 |
+
LLM_BINDING=ollama
|
83 |
+
LLM_BINDING_HOST=http://localhost:11434
|
84 |
+
LLM_MODEL=mistral-nemo:latest
|
85 |
+
|
86 |
+
# Embedding Configuration
|
87 |
+
EMBEDDING_BINDING=ollama
|
88 |
+
EMBEDDING_BINDING_HOST=http://localhost:11434
|
89 |
+
EMBEDDING_MODEL=bge-m3:latest
|
90 |
+
|
91 |
+
# RAG Configuration
|
92 |
+
MAX_ASYNC=4
|
93 |
+
MAX_TOKENS=32768
|
94 |
+
EMBEDDING_DIM=1024
|
95 |
+
MAX_EMBED_TOKENS=8192
|
96 |
+
|
97 |
+
# Security
|
98 |
+
LIGHTRAG_API_KEY=
|
99 |
+
|
100 |
+
# Logging
|
101 |
+
LOG_LEVEL=INFO
|
102 |
+
|
103 |
+
# Optional SSL Configuration
|
104 |
+
#SSL=true
|
105 |
+
#SSL_CERTFILE=/path/to/cert.pem
|
106 |
+
#SSL_KEYFILE=/path/to/key.pem
|
107 |
+
|
108 |
+
# Optional Timeout
|
109 |
+
#TIMEOUT=30
|
110 |
+
```
|
111 |
+
|
112 |
+
### Configuration Priority
|
113 |
+
|
114 |
+
The configuration values are loaded in the following order (highest priority first):
|
115 |
+
1. Command-line arguments
|
116 |
+
2. Environment variables
|
117 |
+
3. Default values
|
118 |
+
|
119 |
+
For example:
|
120 |
+
```bash
|
121 |
+
# This command-line argument will override both the environment variable and default value
|
122 |
+
python lightrag.py --port 8080
|
123 |
+
|
124 |
+
# The environment variable will override the default value but not the command-line argument
|
125 |
+
PORT=7000 python lightrag.py
|
126 |
+
```
|
127 |
|
128 |
#### LightRag Server Options
|
129 |
|