A vision-language AI pipeline combining LLaVA for image analysis with GPT-OSS for advanced reasoning capabilities.
This project implements a two-stage vision pipeline:
- LLaVA Vision Analysis - Processes images and generates detailed descriptions
- GPT-OSS Reasoning - Applies chain-of-thought reasoning to the visual analysis
- 🔍 Image analysis using LLaVA 7B vision model
- 🧠 Advanced reasoning with GPT-OSS 20B language model
- 🖥️ GPU monitoring and temperature management
- 📝 Comprehensive logging
- 💾 JSON output for analysis results
- 🔄 Interactive CLI mode
- Python 3.8+
- Ollama installed and running
- Required Ollama models:
llava:7b- Vision modelgpt-oss:20b- Language model
- Clone the repository:
git clone https://github.com/YOUR_USERNAME/gptoss-vision-project.git
cd gptoss-vision-project- Install dependencies:
pip install pillow requests- Pull required Ollama models:
ollama pull llava:7b
ollama pull gpt-oss:20b- Start Ollama server:
ollama servepython scripts/gptoss_llava_pipeline.pyThis launches an interactive CLI where you can:
- Analyze images by providing their path
- Ask specific questions about images
- View detailed analysis results
from scripts.gptoss_llava_pipeline import GPTOSSLLaVAPipeline
pipeline = GPTOSSLLaVAPipeline()
result = pipeline.analyze_image("path/to/image.jpg", question="What is happening in this image?")
print(result["vision_analysis"])
print(result["gptoss_reasoning"])gptoss-vision-project/
├── scripts/
│ ├── config.py # Configuration settings
│ ├── gptoss_llava_pipeline.py # Main pipeline
│ ├── utils.py # Utility functions
│ └── test_llava.py # Test scripts
├── datasets/
│ ├── images/ # Input images
│ └── captions/ # Generated captions
├── checkpoints/ # Model checkpoints
├── logs/ # Log files
└── outputs/ # Analysis results (JSON)
Edit scripts/config.py to customize:
- Ollama host and port
- Model names
- Hardware limits (VRAM, temperature)
- Inference parameters (temperature, top_p, max tokens)
- GPU with 8GB+ VRAM recommended
- 16GB+ system RAM
- Models run in 4-bit quantization mode for efficiency
MIT License