Files

26 lines
1.4 KiB
Markdown

# ML service
[Русский](README.md) | English
Python/FastAPI embedding service for semantic matching. `POST /v1/embeddings` uses Giga-Embeddings-instruct-480M or Qwen3-Embedding-0.6B; model revisions and file SHA-256 hashes are pinned in `model/`. Text generation and resume analysis are outside the current HTTP service.
- `src/lincodex_ml/` - API, model loading, and CPU/CUDA inference.
- `codegen/` - Pydantic models generated from `api/ml/`.
- `tests/` - unit, contract, and separate real-model tests.
- `model/` - weight revisions and hashes; `uv.lock` - Python dependencies.
From the repository root:
```sh
make -C ml install
make -C ml check
make -C deploy ml-build
make -C deploy ml-up
```
Compose needs a running core and the shared `ML_SERVICE_TOKEN` in `.env`. The image includes both models; `/readyz` returns 200 after loading and warmup. The configured bearer token protects every route except `/healthz` and `/readyz`. Without a token, access is limited to loopback clients.
For a local process, run `make -C ml model-fetch`, then `make -C ml run` with `ML_EMBEDDER` and model directories in the environment. `make -C ml test-model` checks real weights; `cuda-requirements` prepares GPU dependencies. Ordinary tests do not establish matching quality or model performance.
Semantic policy setup, CPU Compose, and a GPU host: [DEPLOYMENT.md](../docs/en/DEPLOYMENT.md#separate-ml-compose-project).