AtlasML Service Overview
AtlasML is a FastAPI-based microservice that exposes competency-centric ML features through a REST API. It integrates tightly with a Weaviate vector database to persist and query embeddings and domain metadata. The service is designed to be modular and observable, with configurable authentication and optional Sentry integration for production use.
Architecture
- FastAPI app:
atlasml/app.py. Creates the application, wires startup/shutdown logic, installs logging middleware, and registers routers. Centralized validation error handling provides consistent 422 responses with debugging details. - Routers:
atlasml/routers/.health.pyoffers a minimal liveness check for probes.competency.pyprovides endpoints for suggesting competencies, persisting items, and proposing relations within a course context. - Models:
atlasml/models/competency.py. Defines request/response Pydantic models for endpoint contracts and core domain DTOs such asCompetencyandExerciseWithCompetencies. - Configuration:
atlasml/config.py. Loads strongly typed settings from environment variables, including API keys, Weaviate endpoints, and optional Sentry DSN. Safe defaults are used in tests or when explicitly requested. - Auth dependencies:
atlasml/dependencies.py. SuppliesTokenValidator/validate_tokendependencies to enforce a simple API-key based authorization using theAuthorizationheader. - Weaviate client:
atlasml/clients/weaviate.py. Manages a singleton Weaviate connection, bootstraps collections and properties, and exposes high-level CRUD/search helpers.
Runtime
- Sentry (optional) is initialized automatically when
ENV=productionandSENTRY_DSNis set. This captures errors and traces with PII only when explicitly enabled. - Request/response logging middleware emits concise request lines, best-effort bodies for POST, response codes, and end-to-end duration. This supports rapid debugging in dev and observability in staging.
- The Weaviate client is checked on startup for liveness and closed gracefully on shutdown, ensuring connections are released and schemas are validated before requests hit the endpoints.
Related Documentation
- API Reference - REST API endpoints and contracts
- Data Models - Pydantic models and DTOs
- Settings & Authentication - Configuration and auth details
- Weaviate Integration - Vector database client