Skip to content

Commit 082c183

Browse files
Merge pull request #5 from abhishekkrthakur/cloudfix
major improvements
2 parents d92a397 + 4fbaa2e commit 082c183

23 files changed

+3221
-415
lines changed

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ LLM_MODEL=openai/gpt-5.1
88
# VESPA_PORT=8080
99
# VESPA_CONFIGSERVER_URL=http://localhost:19071
1010

11-
# Vespa Cloud (required when deploy_mode: cloud in config)
11+
# Vespa Cloud (optional if cloud_tenant is set in config or Vespa CLI target is set; env vars override)
12+
# VESPA_TEAM_API_KEY=your-team-api-key # preferred for cloud deploys
1213
# VESPA_CLOUD_TENANT=your-tenant
1314
# VESPA_CLOUD_APPLICATION=your-app # optional; defaults to generated app name (e.g. nyrag<projectname>)
1415
# VESPA_CLOUD_INSTANCE=default

README.md

Lines changed: 47 additions & 203 deletions
Original file line numberDiff line numberDiff line change
@@ -52,139 +52,75 @@ cd nyrag
5252
pip install -e .
5353
```
5454

55-
## Quick Start
55+
## Usage
5656

57-
nyrag operates in two deployment modes (**Local** or **Cloud**) and two data modes (**Web** or **Docs**):
57+
NyRAG is designed to be used primarily through its web UI, which manages the entire lifecycle from data processing to chat.
5858

59-
| Deployment | Data Mode | Description |
60-
|------------|-----------|-------------|
61-
| Local | Web | Crawl websites → Local Vespa Docker |
62-
| Local | Docs | Process documents → Local Vespa Docker |
63-
| Cloud | Web | Crawl websites → Vespa Cloud |
64-
| Cloud | Docs | Process documents → Vespa Cloud |
59+
### 1. Start the UI
6560

66-
---
67-
68-
## Local Mode
61+
**Local Mode** (requires Docker):
62+
```bash
63+
nyrag ui
64+
```
6965

70-
Runs Vespa in a local Docker container. Great for development and testing.
66+
**Cloud Mode** (requires Vespa Cloud account):
67+
```bash
68+
nyrag ui --cloud
69+
```
7170

72-
### Web Crawling (Local)
71+
Open http://localhost:8000 in your browser.
7372

74-
```bash
75-
export NYRAG_LOCAL=1
73+
### 2. Configure & Process
7674

77-
nyrag process --config configs/example.yml
78-
```
75+
In the UI, you can create a new configuration for your data source.
7976

80-
Example config for web crawling:
77+
**Example Web Crawl Config:**
8178

8279
```yaml
8380
name: mywebsite
8481
mode: web
8582
start_loc: https://example.com/
86-
exclude:
87-
- https://example.com/admin/*
88-
- https://example.com/private/*
89-
9083
crawl_params:
9184
respect_robots_txt: true
92-
follow_subdomains: true
93-
user_agent_type: chrome
94-
9585
rag_params:
9686
embedding_model: sentence-transformers/all-MiniLM-L6-v2
97-
chunk_size: 1024
98-
chunk_overlap: 50
87+
llm_api_key: your-api-key
88+
llm_model: openai/gpt-4o
9989
```
10090
101-
### Document Processing (Local)
102-
103-
```bash
104-
export NYRAG_LOCAL=1
105-
106-
nyrag process --config configs/doc_example.yml
107-
```
108-
109-
Example config for document processing:
91+
**Example Docs Processing Config:**
11092
11193
```yaml
11294
name: mydocs
11395
mode: docs
11496
start_loc: /path/to/documents/
115-
exclude:
116-
- "*.csv"
117-
11897
doc_params:
11998
recursive: true
120-
file_extensions:
121-
- .pdf
122-
- .docx
123-
- .txt
124-
- .md
125-
12699
rag_params:
127100
embedding_model: sentence-transformers/all-mpnet-base-v2
128-
chunk_size: 512
129-
chunk_overlap: 50
130-
```
131-
132-
### Chat UI (Local)
133-
134-
After crawling/processing is complete:
135-
136-
```bash
137-
export NYRAG_CONFIG=configs/example.yml
138-
export LLM_API_KEY=your-api-key
139-
export LLM_MODEL=openai/gpt-5.1
140-
141-
nyrag ui
101+
llm_api_key: your-api-key
102+
llm_model: openai/gpt-4o
142103
```
143104
144-
Open http://localhost:8000/chat
145-
146-
---
147-
148-
## Cloud Mode
149-
150-
Deploys to Vespa Cloud for production use.
151-
152-
### Web Crawling (Cloud)
153-
154-
```bash
155-
export NYRAG_LOCAL=0
156-
export VESPA_CLOUD_TENANT=your-tenant
157-
158-
nyrag process --config configs/example.yml
159-
```
160-
161-
### Document Processing (Cloud)
162-
163-
```bash
164-
export NYRAG_LOCAL=0
165-
export VESPA_CLOUD_TENANT=your-tenant
166-
167-
nyrag process --config configs/doc_example.yml
168-
```
105+
### 3. Chat
169106
170-
### Chat UI (Cloud)
107+
Once processing is complete, you can start chatting with your data immediately in the UI. Make sure your configuration includes your LLM API key and model selection.
171108
172-
After crawling/processing is complete:
173109
174-
```bash
175-
export NYRAG_CONFIG=configs/example.yml
176-
export VESPA_URL="https://<your-endpoint>.z.vespa-app.cloud"
177-
export LLM_API_KEY=your-api-key
178-
export LLM_MODEL=openai/gpt-5.1
110+
## Configuration Reference
179111
180-
nyrag ui
181-
```
112+
### Cloud Deploy Parameters
182113
183-
Open http://localhost:8000/chat
114+
| Parameter | Type | Default | Description |
115+
|-----------|------|---------|-------------|
116+
| `cloud_tenant` | str | `None` | Vespa Cloud tenant (required for cloud mode if no env/CLI target) |
184117

185-
---
118+
### Connection Parameters
186119

187-
## Configuration Reference
120+
| Parameter | Type | Default | Description |
121+
|-----------|------|---------|-------------|
122+
| `vespa_url` | str | `None` | Vespa endpoint URL (auto-filled into `conf.yml` after deploy) |
123+
| `vespa_port` | int | `None` | Vespa endpoint port (auto-filled into `conf.yml` after deploy) |
188124

189125
### Web Mode Parameters (`crawl_params`)
190126

@@ -224,118 +160,26 @@ Open http://localhost:8000/chat
224160

225161
---
226162

227-
## Environment Variables
228-
229-
### Deployment Mode
230-
231-
| Variable | Description |
232-
|----------|-------------|
233-
| `NYRAG_LOCAL` | `1` for local Docker, `0` for Vespa Cloud |
234-
235-
### Local Mode
236-
237-
| Variable | Description |
238-
|----------|-------------|
239-
| `NYRAG_VESPA_DOCKER_IMAGE` | Docker image (default: `vespaengine/vespa:latest`) |
240-
241-
### Cloud Mode
242-
243-
| Variable | Description |
244-
|----------|-------------|
245-
| `VESPA_CLOUD_TENANT` | Your Vespa Cloud tenant |
246-
| `VESPA_CLOUD_APPLICATION` | Application name (optional) |
247-
| `VESPA_CLOUD_INSTANCE` | Instance name (default: `default`) |
248-
| `VESPA_CLOUD_API_KEY_PATH` | Path to API key file |
249-
| `VESPA_CLIENT_CERT` | Path to mTLS certificate |
250-
| `VESPA_CLIENT_KEY` | Path to mTLS private key |
251-
252-
### Chat UI
253-
254-
| Variable | Description |
255-
|----------|-------------|
256-
| `NYRAG_CONFIG` | Path to config file |
257-
| `VESPA_URL` | Vespa endpoint URL (optional for local, required for cloud) |
258-
| `VESPA_SCHEMA` | Override schema name from config |
259-
| `EMBEDDING_MODEL` | Override embedding model from config |
260-
| `LLM_BASE_URL` | LLM API base URL (OpenAI-compatible API) |
261-
| `LLM_MODEL` | LLM model name |
262-
| `LLM_API_KEY` | LLM API key |
263-
264-
**Configuration Priority:** Environment variables always take precedence over config file values. When both are set, env vars override the config file.
265-
266-
---
267-
268-
## Using Local Models
269-
270-
NyRAG supports running LLMs locally using any OpenAI-compatible server. Here are some popular options:
271-
272-
### Ollama
273-
274-
1. **Install Ollama**: [https://ollama.ai](https://ollama.ai)
275-
276-
2. **Pull a model**:
277-
```bash
278-
ollama pull llama3.2
279-
```
280-
281-
3. **Configure NyRAG** (option 1: environment variables):
282-
```bash
283-
export LLM_BASE_URL=http://localhost:11434/v1
284-
export LLM_MODEL=llama3.2
285-
export LLM_API_KEY=dummy # Any value works
286-
```
287-
288-
4. **Or configure in YAML**:
289-
```yaml
290-
rag_params:
291-
llm_base_url: http://localhost:11434/v1
292-
llm_model: llama3.2
293-
llm_api_key: dummy
294-
```
295163

296-
5. **Start the chat UI**:
297-
```bash
298-
nyrag ui
299-
```
164+
## LLM Provider Support
300165

301-
### LM Studio
166+
NyRAG works with any OpenAI-compatible API. Just configure the `rag_params` in your UI settings.
302167

303-
1. **Install LM Studio**: [https://lmstudio.ai](https://lmstudio.ai)
168+
| Provider | Base URL | Model Example | API Key |
169+
|----------|----------|---------------|---------|
170+
| **Ollama** | `http://localhost:11434/v1` | `llama3.2` | `dummy` |
171+
| **LM Studio** | `http://localhost:1234/v1` | `local-model` | `dummy` |
172+
| **vLLM** | `http://localhost:8000/v1` | `meta-llama/Llama-3.2-3B-Instruct` | `dummy` |
173+
| **OpenRouter** | `https://openrouter.ai/api/v1` | `anthropic/claude-3.5-sonnet` | `your-key` |
174+
| **OpenAI** | `None` (default) | `openai/gpt-4o` | `your-key` |
304175

305-
2. **Load a model and start the server** (default port: 1234)
176+
**Example Config:**
306177

307-
3. **Configure NyRAG**:
308-
```bash
309-
export LLM_BASE_URL=http://localhost:1234/v1
310-
export LLM_MODEL=local-model # Model name from LM Studio
311-
export LLM_API_KEY=dummy
312-
```
313-
314-
### vLLM
315-
316-
1. **Install and run vLLM**:
317-
```bash
318-
pip install vllm
319-
python -m vllm.entrypoints.openai.api_server \
320-
--model meta-llama/Llama-3.2-3B-Instruct \
321-
--port 8000
322-
```
323-
324-
2. **Configure NyRAG**:
325-
```bash
326-
export LLM_BASE_URL=http://localhost:8000/v1
327-
export LLM_MODEL=meta-llama/Llama-3.2-3B-Instruct
328-
export LLM_API_KEY=dummy
329-
```
330-
331-
### OpenRouter (Cloud)
332-
333-
For access to 100+ models without local setup:
334-
335-
```bash
336-
export LLM_BASE_URL=https://openrouter.ai/api/v1
337-
export LLM_MODEL=anthropic/claude-3.5-sonnet
338-
export LLM_API_KEY=your-openrouter-key
178+
```yaml
179+
rag_params:
180+
llm_base_url: http://localhost:11434/v1 # Optional: remove for OpenAI
181+
llm_model: llama3.2
182+
llm_api_key: dummy
339183
```
340184

341185
---

0 commit comments

Comments
 (0)