# ───────────────────────────────────────────────────────────────────── # nano-NOTEBOOKLM configuration # Copy to `.env` and fill in the providers you actually use. You need # AT LEAST ONE backend (openai / claude / local) configured for chat # to work. # # After first boot, `artifacts/providers.json` becomes the source of # truth — the Settings UI lets you add / edit / delete / test providers # without restarting. The env vars below are the BOOTSTRAP SEED only: # changing them after providers.json exists has no effect (operator # edits win). Delete providers.json + restart to re-seed from env. # ───────────────────────────────────────────────────────────────────── # ─── 1. OpenAI-compatible provider (recommended) ───────────────────── # Works with any service that exposes /v1/chat/completions — 16+ named # vendors below plus OneAPI-style proxies and your own self-hosted # gateways. Anything not in this cheat sheet still "just works" via # the Settings UI as long as the endpoint is OpenAI-compatible. # Cheat sheet — set OPENAI_BASE_URL + OPENAI_MODEL to one of: # # OpenAI https://api.openai.com/v1 gpt-4o-mini # DeepSeek https://api.deepseek.com/v1 deepseek-v4-pro # Moonshot https://api.moonshot.cn/v1 moonshot-v1-8k # Zhipu https://open.bigmodel.cn/api/paas/v4 glm-4-flash # MiniMax https://api.minimax.chat/v1 abab6.5-chat # Groq https://api.groq.com/openai/v1 llama-3.3-70b-versatile # Together https://api.together.xyz/v1 meta-llama/Llama-3.3-70B-Instruct-Turbo # Gemini https://generativelanguage.googleapis.com/v1beta/openai/ gemini-2.0-flash # xAI Grok https://api.x.ai/v1 grok-4 # OpenRouter https://openrouter.ai/api/v1 openai/gpt-4o-mini # Perplexity https://api.perplexity.ai sonar-pro # Mistral https://api.mistral.ai/v1 mistral-large-latest # DashScope https://dashscope-intl.aliyuncs.com/compatible-mode/v1 qwen-plus # Fireworks https://api.fireworks.ai/inference/v1 accounts/fireworks/models/deepseek-v3p1 # SiliconFlow https://api.siliconflow.cn/v1 Qwen/Qwen2.5-72B-Instruct # Cerebras https://api.cerebras.ai/v1 llama-3.3-70b # OPENAI_API_KEY= OPENAI_BASE_URL=https://api.openai.com/v1 OPENAI_MODEL=gpt-4o-mini # ─── 2. Anthropic Claude (native API, optional) ────────────────────── ANTHROPIC_API_KEY= CLAUDE_MODEL=claude-sonnet-4-5 # ─── 3. Local model via OpenAI-compatible /v1 (optional) ───────────── # Ollama: LOCAL_LLM_BASE_URL=http://localhost:11434/v1 model=qwen2.5:7b # vLLM: LOCAL_LLM_BASE_URL=http://localhost:8000/v1 model= # LM Studio: LOCAL_LLM_BASE_URL=http://localhost:1234/v1 model= # llama.cpp: LOCAL_LLM_BASE_URL=http://localhost:8080/v1 model= LOCAL_LLM_BASE_URL= LOCAL_LLM_MODEL= LOCAL_LLM_API_KEY=local # ─── Default backend ───────────────────────────────────────────────── # Which one to use when a request doesn't specify. One of: openai, claude, local. DEFAULT_BACKEND=openai # ─── Embeddings ────────────────────────────────────────────────────── # The Settings UI exposes three switchable presets (Local MiniLM / # OpenAI text-embedding-3-large / BGE-M3). The chosen preset is # persisted to `artifacts/embedding_preference.json` and OVERRIDES the # env values below — env is only consulted as the first-run default. # # Each preset gets its own FAISS index namespace (`indices/faiss//`) # so toggling between them is a path-route, not a destructive rebuild; # the first switch to a never-used preset triggers a one-shot background # rebuild of every course's index. # # - "local" → sentence-transformers (offline, downloads on first use). # Default multilingual MiniLM handles 50+ languages incl. CJK. # - "api" → OpenAI-compatible /v1/embeddings. Falls back to OPENAI_* by # default; set EMBEDDING_API_BASE_URL / EMBEDDING_API_KEY to # route embeddings to a different provider than chat. EMBEDDING_MODE=local # EMBEDDING_MODEL=paraphrase-multilingual-MiniLM-L12-v2 # local_mini preset # EMBEDDING_MODEL=text-embedding-3-large # openai_large preset # EMBEDDING_MODEL=BAAI/bge-m3 # bge_m3 preset # EMBEDDING_API_KEY= # EMBEDDING_API_BASE_URL= # ─── Paths ─────────────────────────────────────────────────────────── # Where uploaded files, indices, KGs, notes, etc. live. Default is # `./artifacts/` relative to the project root. # ARTIFACTS_DIR=./artifacts # ─── MinerU PDF extractor (optional) ───────────────────────────────── # Install with: `uv pip install -e ".[mineru]"` (heavy: ~3-5GB w/ models). # When engine=mineru is used for an upload, the backend keeps a # persistent mineru-api subprocess alive so re-uploads don't pay the # 30-45s model load each time. Tuning knobs: # MINERU_DEVICE_MODE — `cuda` / `cpu` / `mps`. Unset (default) → auto: # `cuda` when torch.cuda is available, else `cpu`. MPS is NOT # auto-selected (mineru pipeline hangs at DocAnalysis init on # Apple Silicon); set explicitly only if your mineru version # unblocks it. # MINERU_API_PORT — preferred port (default 47865); falls back to # an ephemeral port on collision. # MINERU_OMP_THREADS — caps OMP/MKL/OPENBLAS thread count inside the # mineru subprocess (default min(8, cpu_count)). Lower this when # running other compute alongside. # MINERU_API_MAX_CONCURRENT_REQUESTS — Linux only (Mac pins to 1). # Lets multiple PDFs run in parallel through the same server. # MINERU_SERVER_DISABLED=1 — force-fallback to the per-call subprocess # CLI (useful if the server is misbehaving in a deploy). # NANO_NLM_DISABLE_MINERU_WARMUP=1 — skip the boot-time warm-up; the # server still starts lazily on first request. # ─── Retrieval / GraphRAG tuning (optional) ────────────────────────── # All have sensible defaults; touch only if behavior needs adjustment. # GRAPHRAG_ENABLED=0 — kill switch for the KG-driven retriever. Set # to 0 to force every chat down the BM25 + vector RAG path # (useful when a course's KG is being rebuilt). # GRAPHRAG_SCORE_GATE_TOP1=0.15 — minimum top-1 cosine score for the # graphrag path to take over from RAG. Lower = more queries # routed to KG; higher = stricter admission. # NANO_NLM_DISABLE_EMBED_WARMUP=1 — skip boot-time embedding warm-up # (the model still loads lazily on the first request). Useful for # CI / containers where the warm-up wallclock hurts.