# Enabling Visual Assistant in Cluebase VMS

## 1. Install and Run Ollama with the LLaVA Model

Create a `compose.yaml` file with the following content:

```yaml
volumes:
  ollama:

services:
  ollama:
    image: ollama/ollama
    container_name: ollama
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]
    environment:
      - OLLAMA_SCHED_SPREAD=1
    ports:
      - "11434:11434"
    volumes:
      - ollama:/root/.ollama
    restart: always

```

Start the Ollama container:

```bash
docker-compose up -d
```

After the container is running, download the `llava` model:

```bash
docker exec -it ollama ollama pull llava
```

---

## 2. Enable Ollama Support in the MySQL Database

Connect to the MySQL database container:

```bash
docker exec -it vms-db mysql -uroot -p
```

When prompted, enter the MySQL root password.

Select the `vcloud` database:

```sql
USE vcloud;
```

Enable Ollama integration by executing the following query:

```sql
UPDATE GeneralSettings SET ollamaStatus="ACTIVE";
```

Exit the MySQL console:

```sql
exit
```

---

## Result

After completing these steps:

- Ollama will be running in Docker
- The `llava` visual model will be installed
- Visual Assistant support will be activated in Cluebase VMS