⚙️ Configuration Guide

🛠️ Command-Line Options

Global Options

Option

Description

Default

--model-name

Name of the Qwen model

"Qwen/Qwen2-7B"

--device

Computing device (cuda/cpu)

"cuda"

--index-path

Custom index location

~/.docsense/index

💾 Index Command

docsense index <directory>

Options:
  --model-name TEXT    Name of the Qwen model [default: Qwen/Qwen2-7B]
  --device TEXT       Computing device (cuda/cpu) [default: cuda]
  --index-path PATH   Custom index location
  --help             Show this message and exit

🔍 Ask Command

docsense ask <question>

Options:
  --model-name TEXT    Name of the Qwen model [default: Qwen/Qwen2-7B]
  --device TEXT       Computing device (cuda/cpu) [default: cuda]
  --index-path PATH   Custom index location
  --help             Show this message and exit

🔄 Daemon Command

docsense daemon

Options:
  --model-name TEXT    Name of the Qwen model [default: Qwen/Qwen2-7B]
  --device TEXT       Computing device (cuda/cpu) [default: cuda]
  --index-path PATH   Custom index location
  --help             Show this message and exit

🎛️ Advanced Usage

Environment Variables 🌍

You can set default options using environment variables:

# Set default model
export DOCSENSE_MODEL="custom-model"

# Set default device
export DOCSENSE_DEVICE="cpu"

# Set default index location
export DOCSENSE_INDEX_PATH="./my_index"

Custom Index Location 📁

# Use custom index location
docsense index ./docs --index-path ./project_index

# Query from custom index
docsense ask "How to use?" --index-path ./project_index

🚀 Performance Tips

Device Selection 💻

# Use CPU for indexing
docsense index ./docs --device cpu

# Use GPU for faster processing
docsense index ./docs --device cuda

Daemon Mode for Multiple Queries ⚡

# Start daemon mode for faster consecutive queries
docsense daemon --device cuda

# Interactive queries
> What is DocSense?
> How do I use it?
> exit  # to quit

Memory Management 🎯

# Use CPU when GPU memory is limited
docsense index ./large-docs --device cpu

# Run daemon mode with CPU
docsense daemon --device cpu