Fix README formatting for new Redis database configuration
Browse files
README.md
CHANGED
|
@@ -46,10 +46,8 @@ Configure these in your Hugging Face Space secrets or local .env file:
|
|
| 46 |
- HF_TOKEN: Hugging Face API token (for Hugging Face models)
|
| 47 |
- HF_API_ENDPOINT_URL: Hugging Face inference API endpoint
|
| 48 |
- USE_FALLBACK: Whether to use fallback providers (true/false)
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
- REDIS_USERNAME: Redis username (optional)
|
| 52 |
-
- REDIS_PASSWORD: Redis password (optional)
|
| 53 |
|
| 54 |
## Provider Details
|
| 55 |
|
|
@@ -93,21 +91,21 @@ Configure with OPENAI_API_KEY environment variable.
|
|
| 93 |
### For Local Development (Windows/Ollama):
|
| 94 |
|
| 95 |
1. Install Ollama:
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
|
| 112 |
For Production Deployment:
|
| 113 |
|
|
@@ -140,13 +138,8 @@ Ollama Connection Issues:
|
|
| 140 |
- Test with test_ollama_connection.py
|
| 141 |
|
| 142 |
Redis Connection Problems:
|
| 143 |
-
-
|
| 144 |
-
-
|
| 145 |
-
REDIS_HOST=redis-10296.c245.us-east-1-3.ec2.redns.redis-cloud.com
|
| 146 |
-
REDIS_PORT=10296
|
| 147 |
-
REDIS_USERNAME=default
|
| 148 |
-
REDIS_PASSWORD=your_password_here
|
| 149 |
-
REDIS_DISABLE_SSL=false
|
| 150 |
|
| 151 |
Model Not Found:
|
| 152 |
- Pull required model: ollama pull <model-name>
|
|
@@ -155,23 +148,24 @@ Model Not Found:
|
|
| 155 |
Diagnostic Scripts:
|
| 156 |
- Run python test_ollama_connection.py to verify Ollama connectivity.
|
| 157 |
- Run python diagnose_ollama.py for detailed connection diagnostics.
|
| 158 |
-
- Run python
|
| 159 |
|
| 160 |
-
##
|
| 161 |
|
| 162 |
-
The Redis connection
|
| 163 |
|
| 164 |
-
|
| 165 |
import redis
|
| 166 |
r = redis.Redis(
|
| 167 |
-
host='redis-
|
| 168 |
-
port=
|
| 169 |
-
decode_responses=True,
|
| 170 |
username="default",
|
| 171 |
-
password="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
)
|
| 173 |
-
|
| 174 |
-
result = r.get('foo')
|
| 175 |
-
print(result) # >>> bar
|
| 176 |
-
|
| 177 |
-
This exact configuration is now implemented in the application.
|
|
|
|
| 46 |
- HF_TOKEN: Hugging Face API token (for Hugging Face models)
|
| 47 |
- HF_API_ENDPOINT_URL: Hugging Face inference API endpoint
|
| 48 |
- USE_FALLBACK: Whether to use fallback providers (true/false)
|
| 49 |
+
|
| 50 |
+
Note: Redis configuration is now hardcoded for reliability.
|
|
|
|
|
|
|
| 51 |
|
| 52 |
## Provider Details
|
| 53 |
|
|
|
|
| 91 |
### For Local Development (Windows/Ollama):
|
| 92 |
|
| 93 |
1. Install Ollama:
|
| 94 |
+
bash
|
| 95 |
+
# Download from https://ollama.com/download/OllamaSetup.exe
|
| 96 |
+
|
| 97 |
+
Pull and run models:
|
| 98 |
+
ollama pull mistral
|
| 99 |
+
ollama pull llama3
|
| 100 |
+
ollama serve
|
| 101 |
+
|
| 102 |
+
Start ngrok tunnel:
|
| 103 |
+
ngrok http 11434
|
| 104 |
+
|
| 105 |
+
Update environment variables:
|
| 106 |
+
OLLAMA_HOST=https://your-ngrok-url.ngrok-free.app
|
| 107 |
+
LOCAL_MODEL_NAME=mistral
|
| 108 |
+
USE_FALLBACK=false
|
| 109 |
|
| 110 |
For Production Deployment:
|
| 111 |
|
|
|
|
| 138 |
- Test with test_ollama_connection.py
|
| 139 |
|
| 140 |
Redis Connection Problems:
|
| 141 |
+
- The Redis configuration is now hardcoded for maximum reliability
|
| 142 |
+
- If issues persist, check network connectivity to Redis Cloud
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
|
| 144 |
Model Not Found:
|
| 145 |
- Pull required model: ollama pull <model-name>
|
|
|
|
| 148 |
Diagnostic Scripts:
|
| 149 |
- Run python test_ollama_connection.py to verify Ollama connectivity.
|
| 150 |
- Run python diagnose_ollama.py for detailed connection diagnostics.
|
| 151 |
+
- Run python test_hardcoded_redis.py to verify Redis connectivity with hardcoded configuration.
|
| 152 |
|
| 153 |
+
## New Redis Database Configuration
|
| 154 |
|
| 155 |
+
The Redis connection now uses the new database credentials:
|
| 156 |
|
| 157 |
+
```python
|
| 158 |
import redis
|
| 159 |
r = redis.Redis(
|
| 160 |
+
host='redis-16717.c85.us-east-1-2.ec2.redns.redis-cloud.com',
|
| 161 |
+
port=16717,
|
|
|
|
| 162 |
username="default",
|
| 163 |
+
password="bNQGmfkB2fRo4KrT3UXwhAUEUmgDClx7",
|
| 164 |
+
decode_responses=True,
|
| 165 |
+
socket_connect_timeout=15,
|
| 166 |
+
socket_timeout=15,
|
| 167 |
+
ssl=True,
|
| 168 |
+
health_check_interval=30,
|
| 169 |
+
retry_on_timeout=True
|
| 170 |
)
|
| 171 |
+
This configuration has been tested and confirmed working.
|
|
|
|
|
|
|
|
|
|
|
|