InsightsLM Local
repository·main·Indexed 42 days ago
https://github.com/theaiautomators/insights-lm-local-packageA local-first, private AI research assistant that allows users to run a full stack of AI services—including LLMs, transcription, TTS, and automation—on their own hardware. Built using Docker, N8N, and Supabase, it integrates Ollama (recommended model qwen3:8b-q4_K_M), Whisper ASR, and Coqui TTS to enable offline document chatting, audio transcription, and podcast generation.
What's inside InsightsLM
- InsightsLM is a fully local, private, and self-hosted AI research assistant. Unlike the cloud-connected version, this package is re-architected to run entirely on your local machine using Docker containers. It allows you to chat with documents (PDFs, text, audio), generate local podcasts via text-to-speech, and transcribe audio using local Whisper models, ensuring all data remains offline and private.
Understand InsightsLM Feature Limitations
mainBe aware of the following current limitations in the local version of InsightsLM:
- Audio Deep Dive: The audio deep dive feature with 2 hosts is not supported in the local version. This requires the cloud version with Google TTS integration.
- Document OCR: The system does not currently perform OCR. It only extracts text from machine-readable PDFs. To support scanned documents, you must manually integrate a tool like Docling.
Architecture and Technology Stack
mainInsightsLM runs a suite of services locally via Docker. The stack consists of:
- Frontend: React, Vite, and TypeScript.
- Backend & Automation: N8N.
- Database & Storage: Local Supabase instance.
- AI/ML Services:
- LLM Inference & Embeddings: Ollama (recommended model:
qwen3:8b-q4_K_M). - Audio Transcription: Whisper ASR.
- Text-to-Speech: Coqui TTS.
- LLM Inference & Embeddings: Ollama (recommended model:
Prerequisites for Installation
mainInstall InsightsLM Local via Step-by-Step Guide
mainThe installation requires setting up a base local AI infrastructure and then layering the InsightsLM configuration on top.
1. Clone Repositories
First, clone the foundation repository, then clone the InsightsLM package inside it:
# Clone the base infrastructure git clone https://github.com/coleam00/local-ai-packaged.git cd local-ai-packaged # Clone the InsightsLM local package inside the base directory git clone https://github.com/theaiautomators/insights-lm-local-package.git2. Configure Environment Variables
- In the
local-ai-packagedroot, copy.env.exampleto.env. - Populate secrets (n8n secrets, postgres password, etc.).
- Generate Supabase
JWT_SECRET,ANON_KEY, andSERVICE_ROLE_KEY. - Open
insights-lm-local-package/.env.copy, copy all variables, and paste them at the end of your main.envfile.
3. Update Docker Compose
- Open the main
docker-compose.ymlin the root. - Open
insights-lm-local-package/docker-compose.yml.copy. - Copy the
whisper-cachevolume and the three services (insights-lm,coqui-tts,whisper-asr) from the.copyfile and paste them into the maindocker-compose.ymlunder their respectivevolumesandservicessections. - Update the Ollama model to
qwen3:8b-q4_K_Mon line 55 of the maindocker-compose.yml.
4. Start Services
Run the start script using the profile appropriate for your hardware (e.g., Nvidia GPU):
python start_services.py --profile gpu-nvidia5. Database and Function Setup
- Import SQL: Log in to Supabase (
http://localhost:8000), go to the SQL Editor, and run the contents ofinsights-lm-local-package/supabase-migration.sql. - Move Functions: Copy all folders from
insights-lm-local-package/supabase/functions/tosupabase/volumes/functions/. - Update Supabase Docker Config: Open
supabase/docker/docker-compose.yml. Copy the environment variables frominsights-lm-local-package/supabase/docker-compose.yml.copyand paste them under thefunctionsservice in the main file. - Restart: Shut down services and restart using the
start_services.pyscript.
# Shutdown command docker compose -p localai -f docker-compose.yml --profile gpu-nvidia down6. Configure N8N Workflows
- Access N8N at
http://localhost:5678. - Import
insights-lm-local-package/n8n/Import_Insights_LM_Workflows.json. - Configure the following credentials in N8N:
- N8N API Key: URL
http://localhost:5678/api/v1. - Webhook Header Auth: Name
Authorization, value set in your.envfile. - Supabase API: Host
http://kong:8000, useSERVICE_ROLE_KEYfrom.env. - Ollama: Base URL
http://ollama:11434.
- N8N API Key: URL
- Run the importer workflow and activate all imported workflows (except "Extract Text").
7. Access the App
Access the frontend at
http://localhost:3010. Create a user in the local Supabase dashboard under Authentication to log in.- In the
Refresh audio URL requirements and constraints
mainTo successfully use the
refresh-audio-urlfunction, the following conditions must be met:- Input: A valid
notebookIdmust be provided in the request body. - Database State: A record must exist in the
notebookstable with the matchingid. - URL Format: The
audio_overview_urlfield in thenotebookstable must follow a format where the segment/audio/is present, allowing the function to identify the storage bucket and file path. - Storage: The file must reside in the
audiobucket within Supabase Storage. - Environment Variables: The function requires
SUPABASE_URLandSUPABASE_SERVICE_ROLE_KEYto be configured in the Supabase environment to perform administrative updates and storage operations.
- Input: A valid
Fix 'Invalid Authentication Credentials' Login Error
mainIf you receive an
invalid authentication credentialserror during login, check the following:1. Check for quotes in
.envEnsure
SUPABASE_ANON_KEYandSUPABASE_SERVICE_ROLE_KEYare not wrapped in quotes.Incorrect:
SUPABASE_ANON_KEY="your-key-here"Correct:
SUPABASE_ANON_KEY=your-key-here2. Rebuild containers after ENV changes
If you updated the Supabase keys in your
.envfile after the initial setup, you must rebuild the containers to load the new environment variables.- Open
start_services.py. - Locate line 77.
- Change
cmd.extend(["up", "-d"])tocmd.extend(["up", "-d", "--build"]). - Run the start command:
python start_services.py --profile <your-profile>
# In start_services.py, change line 77: cmd.extend(["up", "-d", "--build"])- Open
Reset Docker containers after volume changes
mainAfter modifying
docker-compose.ymlto use named volumes (to fix macOS upload errors), you must clear the old bind-mount data and orphans before restarting the services.docker compose -p localai -f docker-compose.yml --profile none down -v --remove-orphans # Then restart python3 start_services.py --profile noneFix Upload Errors on macOS with Docker Desktop
mainIf you encounter the error
Upload Error. Failed to upload document X. Please try again.on macOS, it is likely due to Docker volume mounting issues. The solution is to switch from a bind-mount to a named volume in yourdocker-compose.yml.- Update
storageservice: Change the volume from a path tosupabase_storage_data:/var/lib/storage. - Update
imgproxyservice: Change the volume tosupabase_storage_data:/var/lib/storage. - Declare the volume: Add
supabase_storage_data:to the top-levelvolumessection at the bottom of the file. - Reset containers: You must remove the old bind-mount data before restarting.
Note: This solution is based on community feedback and has not been independently verified by the maintainers.
# 1. Update storage service services: storage: image: supabase/storage-api:v1.25.7 volumes: - supabase_storage_data:/var/lib/storage # 2. Update imgproxy service imgproxy: image: darthsim/imgproxy:v3.8.0 volumes: - supabase_storage_data:/var/lib/storage # 3. Declare the volume at the bottom volumes: supabase_storage_data:- Update
Resolve Langfuse Encryption Errors
mainIf you encounter encryption errors when using Langfuse, you must generate a valid 32-byte hex encryption key using OpenSSL and add it to your
.envfile asENCRYPTION_KEY.openssl rand -hex 32Troubleshoot 'Failed to Fetch' Login Error
mainAFailed to Fetcherror on the login screen typically indicates that theSUPABASE_ANON_KEYor the Project URL has been configured incorrectly in your environment settings.Configure environment variables for generate-audio-overview
mainTo function correctly, the
generate-audio-overviewEdge function requires the following environment variables to be set in your Supabase project:Variable Description SUPABASE_URLThe base URL of your Supabase project. SUPABASE_SERVICE_ROLE_KEYThe service role key used to bypass Row Level Security (RLS) when updating notebook status. AUDIO_GENERATION_WEBHOOK_URLThe endpoint URL of the external service responsible for audio generation. NOTEBOOK_GENERATION_AUTHThe authorization header value required by the external audio generation webhook.