- FastAPI backend with JWT auth, roles (admin/moderator/user) - PDF upload (up to 500MB) with streaming, PyMuPDF text extraction - ChromaDB vectorization per page with metadata - LiteLLM AI question extraction from PDF (not generation) - Image extraction from PDF pages, graceful fallback - Quiz modes: timed (countdown timer) + learning (answers shown inline) - Page-by-page question navigation with dot navigator - TTS endpoint using LiteLLM (Google Vertex / OpenAI voices) - Admin dashboard: AI model management per task, user role management - Moderator role: upload PDFs, create sections, generate quizzes - Spaced repetition reminders via SMTP email (SM-2 intervals) - APScheduler daily reminder jobs - Celery + Redis for background PDF processing - React frontend with all pages - Docker Compose deployment (nginx + backend + celery + redis) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
18 lines
715 B
Python
18 lines
715 B
Python
from datetime import datetime
|
|
|
|
from sqlalchemy import Column, Integer, String, Boolean, DateTime
|
|
|
|
from app.database import Base
|
|
|
|
|
|
class AIModelConfig(Base):
|
|
__tablename__ = "ai_model_configs"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
name = Column(String, nullable=False) # display name
|
|
model_id = Column(String, nullable=False, unique=True) # litellm model id e.g. gpt-4o-mini
|
|
task = Column(String, nullable=False) # extraction, tts, general
|
|
api_key = Column(String, nullable=True) # override api key, if null uses default
|
|
is_active = Column(Boolean, default=True)
|
|
is_default = Column(Boolean, default=False)
|
|
created_at = Column(DateTime, default=datetime.utcnow)
|