CircuitLens AI visual electronics troubleshooting runtime
pip install circuitlens Copy PIP instructions
CircuitLens can use Cactus as a local-first VLM and fall back to Gemini. Cactus exposes an OpenAI-compatible server, so install it and start a vision-capable model in a separate terminal:
brew install cactus-compute/cactus/cactus cactus serve Cactus-Compute/gemma-4-e2b-it-hybrid --port 8080 Copy .env.example to .env, set CACTUS_ENABLED=true, and keep AI_PROVIDER=hybrid. The app will call Cactus at http://127.0.0.1:8080/v1 first, then use Gemini if Cactus is unavailable. To require Cactus only, set AI_PROVIDER=cactus.
The existing cactus run command is interactive CLI usage. For CircuitLens integration, use cactus serve, which provides the HTTP endpoint consumed by the Vite server.
The Pi does not need Node.js or npm. Build the frontend on the development machine, then copy the generated dist/ directory, server.py, and .env to the Pi. The Python runtime serves the UI and handles the Gemini/Cactus API routes:
# On the development machine npm run build scp -r dist server.py .env pi@ :/home/pi/circuitlens/ # On Raspberry Pi OS cd ~/circuitlens python3 server.py Open http:// :5173 from a browser on the Pi or another device on the same network. A USB or CSI camera and microphone can be used by the browser through the existing image and voice controls. For the Pi to use a local VLM, point CACTUS_BASE_URL at a Cactus server that supports the Pi architecture; otherwise set AI_PROVIDER=gemini or keep AI_PROVIDER=hybrid for cloud fallback.
Copy the deployment files to the Pi once. After that, the Pi runs the complete device and starts the services on boot:
mkdir -p ~/circuitlens # Copy dist/, server.py, .env, and rpi/ into ~/circuitlens first. cd ~/circuitlens sudo bash rpi/install.sh sudo bash rpi/setup-cactus.sh Use AI_PROVIDER=hybrid and CACTUS_ENABLED=true in /opt/circuitlens/.env for local Cactus first with Gemini fallback. For fully offline operation, use AI_PROVIDER=cactus, CACTUS_ENABLED=true, and --no-cloud-handoff is already enabled by the Cactus service. Check the device with:
systemctl status circuitlens cactus curl http://127.0.0.1:5173/health The Pi 5 is ARM64, which is the architecture expected by Cactus's native NEON runtime. The earlier Cactus failure happened only in x86-64 Kali WSL, not on the target Pi architecture.
The production frontend is bundled into a Python wheel. The wheel contains the Python runtime and built HTML/CSS/JavaScript files; it does not contain node_modules and does not require Node.js at runtime.
Use this while testing the package before publishing it to the public PyPI index:
python -m pip install --index-url https://test.pypi.org/simple/ circuitlens circuitlens If dependency resolution needs packages from normal PyPI as well, use:
python -m pip install circuitlens circuitlens The command starts the local server at http://0.0.0.0:5173. Set CIRCUITLENS_HOST or CIRCUITLENS_PORT to change the bind address or port.
Create a .env file in the directory where you run circuitlens when using Gemini or Cactus:
AI_PROVIDER=hybrid CACTUS_ENABLED=true CACTUS_BASE_URL=http://127.0.0.1:8080/v1 CACTUS_MODEL=Cactus-Compute/gemma-4-e2b-it-hybrid GEMINI_API_KEY=replace_with_your_gemini_api_key GEMINI_MODEL=gemini-3.1-pro-preview For fully offline operation, use AI_PROVIDER=cactus and run a compatible local Cactus VLM. For Gemini-only operation, use AI_PROVIDER=gemini. The wheel does not include Cactus model weights.
For maintainers, build it after building the frontend:
npm run build python -m build --wheel --no-isolation --outdir wheelhouse python -m venv package-test package-test/bin/pip install wheelhouse/circuitlens-*.whl package-test/bin/circuitlens On Windows, use package-test\\Scripts\\pip.exe and package-test\\Scripts\\circuitlens.exe. The package name is circuitlens.
CircuitLens is a phone-first AI electronics troubleshooting assistant that combines camera context, voice/text symptoms, multimodal AI and structured diagnostic reasoning to help engineers determine what to test next.
CircuitLens is designed to bridge the gap between seeing a physical hardware problem and knowing what to test next.
OBSERVE → HYPOTHESIZE → TEST → UPDATE → NEXT TEST
The following image represents the proposed CircuitLens user interface and product direction.
Debugging electronics is still heavily dependent on engineering experience.
When a sensor, peripheral or embedded system fails, engineers commonly move between:
SYMPTOM ↓ INSPECT HARDWARE ↓ SEARCH DOCUMENTATION ↓ CHECK CODE ↓ GUESS POSSIBLE CAUSE ↓ RUN A TEST ↓ REPEAT The physical hardware contains important information, but most existing troubleshooting workflows begin with text, logs or code.
CircuitLens turns an Android smartphone into a visual engineering troubleshooting assistant.
The user points the phone camera at an electronic setup and describes the problem through voice or text.
CAMERA CONTEXT + USER SYMPTOM + HARDWARE CONTEXT + TECHNICAL KNOWLEDGE + PREVIOUS TEST RESULTS to construct a structured diagnostic path.
"Check your wiring, power supply, I²C address and sensor configuration."
"Which test should I perform next to reduce uncertainty?"
OBSERVE ↓ HYPOTHESIZE ↓ SELECT NEXT BEST TEST ↓ PERFORM TEST ↓ CAPTURE RESULT ↓ UPDATE HYPOTHESES ↓ SELECT NEXT TEST This makes CircuitLens an iterative diagnostic system, rather than a one-shot chatbot.
The initial MVP focuses on a real embedded-system setup:
"My ADXL345 is not giving the correct acceleration values."
The system can consider possible causes such as:
STM32F407G-DISC1 + ADXL345 + I²C The vision pipeline can identify relevant hardware and visible context.
The voice input is converted into structured symptom information.
01 I²C communication 02 Incorrect address 03 Power / GND 04 Sensor configuration 4. Next Best Test Instead of presenting every possible fix, CircuitLens selects a diagnostic action.
┌────────────────────────────────┐ │ NEXT BEST TEST │ │ │ │ Read ADXL345 DEVID register │ │ │ │ Expected result: 0xE5 │ └────────────────────────────────┘ The test is useful because its result can provide evidence about communication and addressing.
TEST RESULT DEVID = 0x00 CircuitLens updates the diagnostic state.
I²C COMMUNICATION HIGH I²C ADDRESS HIGH POWER / GND MEDIUM CONFIGURATION LOWER The system can then recommend:
NEXT TEST Verify SDA / SCL continuity and confirm the I²C address. The investigation continues until sufficient evidence is available.
The smartphone is not simply a display for a desktop application.
It acts as the primary sensing, interaction and guidance device.
CAMERA ↓ PHYSICAL HARDWARE CONTEXT ↓ VOICE / TEXT SYMPTOM ↓ MULTIMODAL REASONING ↓ FAULT HYPOTHESES ↓ NEXT BEST TEST ↓ TEST RESULT ↓ UPDATED DIAGNOSIS 🏗️ System Architecture CircuitLens is designed around a mobile-first architecture.
ANDROID PHONE │ ┌─────────────┴─────────────┐ │ │ CAMERA VOICE │ │ CameraX Audio Input │ │ └─────────────┬─────────────┘ ↓ IMAGE PREPROCESSING │ ┌──────────┴──────────┐ │ │ OCR LIGHTWEIGHT CV │ │ └──────────┬──────────┘ ↓ HARDWARE CONTEXT │ ↓ LOCAL MULTIMODAL AI Gemma 3n │ ↓ STRUCTURED JSON │ ↓ DIAGNOSTIC ENGINE │ ┌──────────┴──────────┐ │ │ HYPOTHESES TEST SELECTION │ │ └──────────┬──────────┘ ↓ NEXT BEST TEST │ ↓ USER RESULT │ └────────→ UPDATE 📲 Proposed Android Technology Stack Application Kotlin Jetpack Compose Android CameraX Android audio / voice input Computer Vision Image preprocessing Lightweight component detection OCR OpenCV where appropriate AI Gemma 3n — proposed local/open multimodal model Structured model output Evidence-aware reasoning Mobile Inference Potential inference technologies include:
Actual performance metrics will be benchmarked during implementation rather than assumed.
Running multimodal AI locally on a smartphone requires careful resource management.
Reduce model size and computational requirements where appropriate.
Avoid running expensive inference on every camera frame.
CAMERA STREAM ↓ LIGHTWEIGHT PROCESSING ↓ RELEVANT FRAME ↓ AI REASONING Region of Interest Focus computation on relevant hardware regions rather than the entire image.
Use lightweight perception frequently and invoke heavier multimodal reasoning only when necessary.
Keep the Android interface responsive while inference is running.
Use available GPU/NPU acceleration where supported by the device and inference framework.
Perform expensive inference only when required and manage model resources according to device constraints.
The AI reasoning layer is designed to return structured information rather than directly controlling the application interface.
{ "hardware": [ "STM32F407G-DISC1", "ADXL345" ], "interface": "I2C", "symptom": "Incorrect acceleration values", "hypotheses": [ { "name": "I2C communication issue", "priority": "high" }, { "name": "Incorrect address", "priority": "high" } ], "next_test": { "name": "Read ADXL345 DEVID", "expected": "0xE5" } } The Android application can interpret this structured output and render a predictable diagnostic interface.
The AI model is responsible for understanding the available information and generating candidate hypotheses.
This separation is intended to make the system more controllable and explainable than a pure conversational AI architecture.
CircuitLens is designed around the capabilities of a modern smartphone.
Make the phone an engineering diagnostic instrument.
CircuitLens can bridge phone-based physical inspection with laptop-based engineering workflows.
PHONE │ ┌────────────┴────────────┐ │ │ CAMERA DIAGNOSIS │ │ └────────────┬────────────┘ ↓ OFFICE KIT ↓ LAPTOP │ ┌────────────┼────────────┐ ↓ ↓ ↓ Firmware Logs Datasheets 🎯 Target Users Embedded Engineers Investigate board and peripheral problems faster.
Learn structured electronics troubleshooting.
Investigate sensors, controllers and communication interfaces.
Use a phone as a portable troubleshooting assistant.
The initial implementation is deliberately constrained.
STM32 + Common Sensors + I²C + Defined Diagnostic Procedures The goal is not to claim that CircuitLens can diagnose every circuit.
The MVP will first validate the workflow against known embedded-system scenarios.
EMBEDDED SYSTEMS ↓ IoT ↓ ROBOTICS ↓ LAB EQUIPMENT ↓ INDUSTRIAL FIELD SERVICE 🛠️ Development Roadmap Phase 1 — Mobile Interface Camera, symptom input and diagnostic UI.
Component recognition, OCR and image processing.
Integrate a mobile-capable local/open multimodal model.
Implement hypothesis generation, ranking and test selection.
Feed test results back into the diagnostic state.
Integrate Office Kit and engineering artifacts.
Validate against real STM32 + sensor failure scenarios.
CircuitLens is currently being developed as a hackathon MVP.
The first prototype focuses on proving the core diagnostic interaction rather than attempting universal electronics diagnosis.
LAUNCH CIRCUITLENS ↓ INSPECT HARDWARE ↓ IDENTIFY CONTEXT ↓ ENTER / SPEAK SYMPTOM ↓ GENERATE HYPOTHESES ↓ SELECT NEXT BEST TEST ↓ ENTER TEST RESULT ↓ UPDATE DIAGNOSIS ↓ SELECT NEXT TEST Where deterministic prototype logic is used during development, it will be clearly distinguished from real AI inference.
CircuitLens starts with embedded-system troubleshooting.
The long-term vision is to help engineers understand physical systems using multimodal AI.
Bridge the gap between seeing an engineering problem and knowing what to test next.
Solo developer with hands-on engineering experience across:
CircuitLens builds on this engineering experience to explore a phone-first AI diagnostic workflow for physical electronics.
node --version npm --version git --version Clone the Repository git clone https://github.com/Samarth-07-14/CircuitLens.git Enter the project directory:
cd CircuitLens Install Dependencies npm install Start the Development Server npm run dev Vite will start the development server.
Open the URL shown in the terminal, typically:
git clone https://github.com/Samarth-07-14/CircuitLens.git cd CircuitLens Install dependencies:
git status git add . git commit -m "Update CircuitLens prototype" git push 📁 Project Structure CircuitLens/ │ ├── public/ │ ├── assets/ │ └── circuitlens-ui.png │ ├── src/ │ ├── components/ │ ├── pages/ │ ├── data/ │ ├── logic/ │ └── ... │ ├── index.html ├── package.json ├── package-lock.json ├── vite.config.ts ├── tsconfig.json ├── tsconfig.app.json ├── tsconfig.node.json ├── tailwind.config.ts ├── postcss.config.js ├── eslint.config.js └── README.md 🤝 Development Priorities The project is being developed with the following priorities:
This project is licensed under the MIT License.
Third-party libraries, frameworks, models and open-source components retain their respective licenses.
🔍 CIRCUITLENS See the hardware. Understand the problem. Test what matters. Point. Ask. Test.
electronics troubleshooting raspberry-pi vlm gemini
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
The dropdown lists show the available interpreters, ABIs, and platforms.
Enable javascript to be able to filter the list of wheel files.
Copy a direct link to the current filters Copy
Details for the file circuitlens-0.1.1-py3-none-any.whl.




