A lightweight FastAPI-based backend for Erudite AI, text generation.
erudite-be/
├── app/
│ ├── __init__.py
│ ├── main.py # Entry point
│ ├── api/
│ │ ├── __init__.py
│ │ ├── endpoints.py # API route definitions
│ ├── core/
│ │ ├── __init__.py
│ │ ├── config.py # Application configuration
│ ├── services/
│ │ ├── __init__.py
│ │ ├── generator.py # Text generation logic
│ └── models/
│ ├── __init__.py
│ └── schemas.py # Request/response validation schemas
├── tests/
│ ├── __init__.py
│ ├── test_endpoints.py # Tests for API endpoints
├── requirements.txt # Python deps
├── README.md
└── run.py # Run script
- Python 3.8+
- Pip
-
Clone the repository:
git clone https://github.com/JagoScript/erudite-be cd erudite-be -
Create and activate a virtual environment:
python -m venv venv venv\Scripts\activate # On Linux: source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
- Start the API:
python run.py
Generates text based on a given prompt.
- Request Body:
{ "prompt": "Your input prompt here" }
- Run Unit Tests:
pytest
- Model Configuration: Update
app/core/config.pyto change the default language model. - Add New Endpoints: Define additional routes in
app/api/endpoints.pyand corresponding logic inapp/services/.
MIT License. See LICENSE for details.
