π€ A private, local AI-powered image analysis application that uses LiquidAI's advanced LFM2-VL vision-language models to analyze images and answer questions about them. All processing happens locally - no data is sent to external servers.
- πΌοΈ Image Analysis from URLs: Analyze any image accessible via URL
- π File Upload Support: Upload images directly from your computer
- π§ Multiple AI Models: Choose between fast (450M) and accurate (1.6B) models
- β‘ Smart Model Management: Download and load models on-demand
- π Fast Processing: Optimized for CPU with efficient model loading
- π User-Friendly Interface: Clean web interface accessible via browser
- π§ Easy Setup: One-script installation for beginners
- π Zero Dependencies: Installs its own Python 3.11 - no system Python needed
- π Complete Privacy: All processing happens locally, no external API calls
git clone https://github.com/fibogacci/lfm2-private-vision.git
cd lfm2-private-visionFor Linux/Raspberry Pi:
./install.shThis will automatically:
- Check system requirements
- Install uv (modern Python package manager)
- Download and install Python 3.11 automatically
- Install all Python dependencies
- Configure the application
Note: The script downloads its own Python 3.11 (~30MB) for optimal compatibility.
./start.shThis will:
- Start the backend server (usually on port 8000)
- Start the frontend server on http://localhost:3000
- Automatically open the correct ports
- Open your web browser
- Go to http://localhost:3000
- Download a model (first time only):
- Click "Download" for 450M model (faster, ~1GB)
- Or click "Download" for 1.6B model (better quality, ~3GB)
- Click "Load" to activate the downloaded model
- Start analyzing images!
- Enter an image URL or upload a file
- Ask a question about the image (e.g., "What do you see?", "What color is the car?")
- Click "Analyze" to get AI-generated answers
- Adjust settings using the gear icon for advanced options
- 450M Model: Faster inference, smaller download (~1GB), good for quick analysis
- 1.6B Model: Higher accuracy, larger download (~3GB), better for detailed analysis
- Download: Downloads the model files to your computer
- Load: Loads the downloaded model into memory for use
- Status: Shows current model state (Not Downloaded/Downloaded/Active)
POST /analyze/
Content-Type: application/json
{
"image_url": "https://example.com/image.jpg",
"question": "What do you see in this image?",
"max_new_tokens": 300
}POST /analyze/file
Content-Type: multipart/form-data
file: <image_file>
question: "Describe this image"GET /model/statusPOST /model/switch
Content-Type: application/json
{
"model_type": "450M" // or "1.6B_remote"
}- LFM2-VL-450M: Smaller, faster model suitable for most use cases
- LFM2-VL-1.6B: Larger, more capable model with better accuracy
Models are automatically downloaded from HuggingFace Hub on first use. The 450M model requires approximately 1GB of storage, while the 1.6B model requires about 3GB.
You can customize text generation with these parameters:
max_new_tokens: Maximum length of generated response (default: 300)do_sample: Enable sampling for more creative responsestemperature: Control randomness (0.1-2.0)top_p: Nucleus sampling parameterrepetition_penalty: Reduce repetitive text
lfm2-private-vision/
βββ backend/
β βββ main.py # FastAPI application
β βββ pyproject.toml # Python dependencies
β βββ uv.lock # Dependency lock file
βββ frontend/
β βββ index.html # Web interface
βββ README.md # This file
Key dependencies include:
fastapi- Web frameworktorch- PyTorch for model inferencetransformers- HuggingFace model integrationpillow- Image processinguvicorn- ASGI server
cd backend
uv run uvicorn main:app --reload --host 0.0.0.0 --port 8000- OS: Linux
- Python: Not required - automatically installed by uv
- RAM: 4GB (8GB+ recommended for 1.6B model)
- Storage: 2GB free space (5GB+ for both models)
- Internet: Required for initial setup and model download
- β Raspberry Pi
- β MX Linux 23
This project is licensed under the MIT License - see the LICENSE file for details.
- Check the log files:
backend.logandfrontend.log - Ensure all requirements are met
- Try restarting:
./start.sh - Open an issue on GitHub with error details
- LiquidAI for the LFM2-VL models
- HuggingFace for the Transformers library
- FastAPI for the web framework

