Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,23 @@ Open `http://localhost:3000`.
- At least one supported model provider key, depending on which models you enable
- LibreOffice for DOC/DOCX to PDF conversion

## LLM Configuration Options

The backend supports multiple LLM providers via environment variables in `backend/.env`:

### Provider Keys
- `GEMINI_API_KEY` - Google Gemini models
- `ANTHROPIC_API_KEY` - Anthropic Claude models
- `OPENROUTER_API_KEY` - OpenRouter (aggregates multiple providers)
- `RESEND_API_KEY` - Resend (for email functionality)

### Local LLM (vLLM) Configuration
For self-hosted vLLM endpoints:
- `VLLM_BASE_URL` - Base URL for your vLLM server (e.g., `https://your-vllm-endpoint.com/v1`)
- `VLLM_API_KEY` - API key for vLLM authentication
- `VLLM_MAIN_MODEL` - Primary model name for vLLM (e.g., `BredaAI`)
- `VLLM_LIGHT_MODEL` - Lightweight model for faster responses (e.g., `your-light-model-name`)

## Checks

```bash
Expand Down
6 changes: 6 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ GEMINI_API_KEY=your-gemini-key
ANTHROPIC_API_KEY=your-anthropic-key
OPENROUTER_API_KEY=your-openrouter-key
RESEND_API_KEY=your-resend-key

# vLLM Configuration (OpenAI-compatible endpoint)
VLLM_BASE_URL=https://your-vllm-endpoint.com/v1
VLLM_API_KEY=your-vllm-api-key
VLLM_MAIN_MODEL=BredaAI
VLLM_LIGHT_MODEL=your-light-model-name
241 changes: 241 additions & 0 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"libreoffice-convert": "^1.6.0",
"mammoth": "^1.9.0",
"multer": "^1.4.5-lts.2",
"openai": "^4.87.3",
"pdfjs-dist": "^4.10.38",
"resend": "^4.5.1"
},
Expand Down
3 changes: 2 additions & 1 deletion backend/src/lib/chatTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2121,7 +2121,8 @@ export async function runToolCalls(
}

} else if (tc.function.name === "generate_docx") {
const title = args.title as string;
// Fallback to "document" if title is missing - model sometimes omits required fields
const title = (args.title as string) || "document";
const landscape = !!(args.landscape);
console.log(`[generate_docx] title="${title}" landscape=${landscape} args.landscape=${args.landscape}`);
const previewFilename = `${(title.replace(/[^a-zA-Z0-9 _-]/g, "").trim().slice(0, 64) || "document")}.docx`;
Expand Down
Loading