Local offline-capable LLM system for embedded C development assistance.
Every time you start working on this project, run through this checklist:
# Check if Ollama is running
systemctl status ollama
# If not running, start it
sudo systemctl start ollama
# Verify models are available
ollama list
# Should show: deepseek-coder:6.7b-instruct and others# Check if Open WebUI is running
sudo systemctl status open-webui
# If not running, start it
sudo systemctl start open-webui
# Verify it's accessible
# Open browser to: http://localhost:8080# Navigate to project directory
cd ~/apps/llm-rag-project
# Activate the venv
source venv/bin/activate
# Your prompt should now show: (venv)- Open WebUI running at
http://localhost:8080 - Ollama serving models at
localhost:11434 - Python environment activated for document processing
βββββββββββββββββββββββββββββββββββββββββββ
β Open WebUI (localhost:8080) β
β Service: open-webui.service β
β Location: /opt/open-webui/ β
ββββββββββββββββ¬βββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β Ollama (localhost:11434) β
β Service: ollama.service β
β Models: deepseek-coder:6.7b-instruct β
ββββββββββββββββ¬βββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β ChromaDB (./chroma_db) β
β - Standards documents β
β - Code samples β
β - Embeddings: bge-small-en-v1.5 β
βββββββββββββββββββββββββββββββββββββββββββ
~/apps/llm-rag-project/
βββ README.md # This file
βββ venv/ # Python virtual environment (DO NOT COMMIT)
βββ standards_pdfs/ # Input: Your PDF standards (J1939, ISO, etc.)
βββ processed_chunks/ # Output: JSONL files from Docling
βββ scripts/ # Python processing scripts
β βββ process_standards.py
β βββ load_to_chromadb.py
β βββ create_code_index.py
βββ sample_projects/ # Known Good C code samples
βββ chroma_db/ # Vector database (created after processing)
βββ requirements.txt # Python dependencies for this project
# Start Ollama
sudo systemctl start ollama
# Stop Ollama
sudo systemctl stop ollama
# Start Open WebUI
sudo systemctl start open-webui
# Stop Open WebUI
sudo systemctl stop open-webui
# Check service status
systemctl status ollama
sudo systemctl status open-webui# Enable Ollama to start on boot
sudo systemctl enable ollama
# Enable Open WebUI to start on boot
sudo systemctl enable open-webui# List installed models
ollama list
# Pull a new model
ollama pull
# Remove a model
ollama rm
# Run a model (keeps it loaded in VRAM)
ollama run deepseek-coder:6.7b-instruct# Activate venv
cd ~/apps/llm-rag-project
source venv/bin/activate
# Deactivate venv
deactivate
# Install new package in venv
pip install
# Save current dependencies
pip freeze > requirements.txt
# Reinstall all dependencies (if venv recreated)
pip install -r requirements.txt# Copy your standards PDFs
cp /path/to/standards/*.pdf ~/apps/llm-rag-project/standards_pdfs/cd ~/apps/llm-rag-project
source venv/bin/activate
python scripts/process_standards.pypython scripts/load_to_chromadb.py- Open browser to
http://localhost:8080 - Navigate to Settings β Documents
- Verify your documents are loaded
- Test a query referencing your standards
# Check logs
sudo journalctl -u open-webui -f
# Check if port 8080 is in use
sudo lsof -i :8080
# Restart the service
sudo systemctl restart open-webui# Check if running
systemctl status ollama
# Check GPU availability
nvidia-smi
# Restart Ollama
sudo systemctl restart ollama
# Check logs
journalctl -u ollama -f# If packages seem broken, recreate venv
cd ~/apps/llm-rag-project
deactivate
rm -rf venv
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt# Monitor GPU during query
nvidia-smi -l 1
# Should show:
# - GPU utilization > 80% during inference
# - Memory usage appropriate for model
# If not using GPU, check Ollama installation
which ollama
ollama run llama2 --verbose # Will show if CUDA detectedCurrent packages (run pip list to see versions):
- docling - PDF processing
- chromadb - Vector database
- sentence-transformers - Embeddings
- (add more as you install them)
- β Use
pip installwithout activating the venv first - β Use
sudo pip installever - β Commit the
venv/directory to git - β Commit the
chroma_db/directory to git (large files) - β Use
--break-system-packagesflag
- β Always activate venv before running Python scripts
- β
Keep
requirements.txtupdated when adding packages - β Check services are running before starting work
- β
Use
deactivatewhen done with Python work - β Document any new scripts or workflows in this README
Ctrl+C- Stop running process (e.g., a Python script)Ctrl+Z- Suspend process (usefgto resume)Ctrl+D- Exit terminal (or deactivate venv)
- Access at:
http://localhost:8080 - Stop service:
sudo systemctl stop open-webui
- OS: Arch Linux (Omarchy Hyperland config)
- GPU: NVIDIA RTX 3050 Ti (4GB VRAM)
- RAM: 64GB
- Storage: 1TB SSD
- Network: 400 Mbps (for initial setup only)
Once everything is set up, this system runs completely offline:
- β Ollama models stored locally
- β Open WebUI runs locally
- β ChromaDB vector database local
- β Embedding model cached locally
- β No external API calls required
To verify offline capability:
# Disable network
sudo systemctl stop NetworkManager
# Test queries in Open WebUI
# Should still work!
# Re-enable network
sudo systemctl start NetworkManager- Ollama: https://ollama.ai/docs
- Open WebUI: https://docs.openwebui.com
- ChromaDB: https://docs.trychroma.com
- Docling: https://github.com/DS4SD/docling
- Arch Wiki - Python: https://wiki.archlinux.org/title/Python
This system is designed to be a subject matter expert for:
- Embedded C programming for automotive ECUs
- J1939 CAN bus protocol implementation
- ISO 15765-2 (CAN transport protocol)
- Infineon TC399 microcontroller programming
- STW controller application development
- Mobile machinery control systems
- "Known Good" coding patterns from sample projects
Use these to verify the system is working correctly:
-
Basic LLM Test:
"Explain the difference between a mutex and a semaphore in RTOS" -
Standards Knowledge Test (after RAG setup):
"What is the purpose of J1939 PGN 64982?" -
Code Pattern Test (after code indexing):
"Show me the recommended CAN message filtering pattern" -
Hardware Specific Test:
"What are the DMA channel limitations on the TC399?"
- 2025-12-30: Initial setup
- Installed Ollama via pacman
- Installed Open WebUI via pacman
- Pulled deepseek-coder:6.7b-instruct
- Created project venv
- Installed docling, chromadb, sentence-transformers
- Process first PDF standard with Docling
- Set up ChromaDB vector database
- Index sample C projects
- Test RAG retrieval accuracy
- Create custom prompt templates in Open WebUI
- Fine-tune chunking strategy based on results