File: /var/www/ai-notam/README.md
# AI NOTAM
Laravel code using files src/common/json-data/summary.json and src/common/json-data/fine-tuning.jsonl to get Preset data for form prototype.
Prompt copied from src/modules/chat-gpt/chat-gpt.service.ts
ChatGPT gpt-4o-mini model used. Calls foes from PHP and request/response/tokens number saved to database.
AlpineJS and JsonEditor (https://jsoneditoronline.org/) libs used on frontend
## Laravel Installation
1. Create empty mysql database
2. Create file .env in root folder and change database params in file + CHAT_GPT_KEY
```
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:ZKDYObOKmodXjqvYmhhJJHApCX5y9DrcDcRHT97DeJA=
APP_DEBUG=true
APP_TIMEZONE=UTC
APP_URL=http://notam.loc
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=notam
DB_USERNAME=root
DB_PASSWORD=root
VITE_APP_NAME="${APP_NAME}"
CHATGPT_API_KEY=CHAT_GPT_KEY
```
3. Execute commands
```
composer install
php artisan migrate
```
4. Point domain/subdomain to /laravel/public folder
5. Open https://YOURSITE.COM/register and create account
6. Login on main site page or https://YOURSITE.COM/login
## Local LLM installation
### In ollama container
build a container:
docker compose -f n8n-docker-compose.yml up -d --build ollama
ollama create notam-model -f /files/Modelfile
ollama run notam-model:latest --hidethinking
### Fine-tuning local model
https://cookbook.openai.com/articles/gpt-oss/fine-tune-transfomers