- Fix remaining "Next.js 14" references in: - docs/architecture/IMPLEMENTATION_QUICK_REFERENCE.md - docs/load-testing/K6_LOAD_TESTING_GUIDE.md - Create README.md for libs/ai-services/ (FastAPI AVM, moderation, NLP) - Create README.md for libs/mcp-servers/ (MCP tool server library) - Note: CLAUDE.md, README.md, and docs/architecture.md were already updated in a prior pass Co-Authored-By: Paperclip <noreply@paperclip.ing>
70 lines
1.8 KiB
Markdown
70 lines
1.8 KiB
Markdown
# @goodgo/ai-services
|
|
|
|
Python FastAPI AI/ML microservice for the GoodGo Platform.
|
|
|
|
## Services
|
|
|
|
| Service | Router | Description |
|
|
|---------|--------|-------------|
|
|
| **AVM** | `/avm` | Automated Valuation Model — XGBoost-based property price predictions |
|
|
| **Moderation** | `/moderation` | Content moderation for listings (text + image analysis) |
|
|
| **NLP** | `/nlp` | Vietnamese NLP — feature extraction, search query understanding |
|
|
|
|
## Tech Stack
|
|
|
|
- **Python** 3.12+
|
|
- **FastAPI** 0.115 + Uvicorn
|
|
- **XGBoost** 2.1 (property valuation model)
|
|
- **Underthesea** 6.8 (Vietnamese NLP tokenizer)
|
|
- **Pydantic** 2.9 (request/response schemas)
|
|
|
|
## Quick Start
|
|
|
|
```bash
|
|
# Via Docker (recommended — runs as part of the platform stack)
|
|
docker compose up -d ai-services
|
|
|
|
# Standalone
|
|
cd libs/ai-services
|
|
pip install -e ".[dev]"
|
|
uvicorn app.main:app --reload --port 8000
|
|
```
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
libs/ai-services/
|
|
├── app/
|
|
│ ├── main.py # FastAPI app entry point
|
|
│ ├── config.py # Settings (Pydantic BaseSettings)
|
|
│ ├── middleware.py # CORS, rate limiting, error handling
|
|
│ ├── models/ # Pydantic request/response schemas
|
|
│ │ ├── avm.py
|
|
│ │ ├── moderation.py
|
|
│ │ └── nlp.py
|
|
│ ├── routers/ # API route handlers
|
|
│ │ ├── avm.py
|
|
│ │ ├── moderation.py
|
|
│ │ └── nlp.py
|
|
│ └── services/ # Business logic
|
|
│ ├── avm_service.py
|
|
│ ├── moderation_service.py
|
|
│ └── nlp_service.py
|
|
├── tests/ # pytest test suite
|
|
├── Dockerfile # Production container image
|
|
└── pyproject.toml # Dependencies and config
|
|
```
|
|
|
|
## Testing
|
|
|
|
```bash
|
|
cd libs/ai-services
|
|
pytest
|
|
```
|
|
|
|
## Health Check
|
|
|
|
```
|
|
GET /health → {"status": "ok"}
|
|
```
|