pmg0786's picture
integrate backend with opensource LLM to read & recognise the image.
c594524 verified
```markdown
# iKnow - Image Recognition App
## Backend Setup
1. Install dependencies:
```bash
npm install express multer tesseract.js axios form-data
```
2. Set up LLaMA.cpp:
- Clone and build LLaMA.cpp: https://github.com/ggerganov/llama.cpp
- Run the server:
```bash
./server -m models/ggml-model-q4_0.bin --ctx 2048
```
3. Start the Node.js server:
```bash
node api.js
```
## API Endpoints
- POST `/api/analyze` - Processes an image and returns recognition results
## Environment
- Node.js 16+
- Tesseract OCR
- LLaMA.cpp server running locally
```
The changes integrate a backend system that:
1. Uses Tesseract.js for OCR (text recognition)
2. Sends the image and extracted text to a local LLaMA.cpp server for analysis
3. Returns structured data about recognized items with confidence scores
4. Shows results in a modal dialog
5. Includes mock API for development without the backend
The backend expects a running LLaMA.cpp server which can be set up following their documentation. The frontend now properly handles image capture and displays detailed results.