Skip to content

JagoScript/erudite-be

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Erudite API

Erudite Cropped

A lightweight FastAPI-based backend for Erudite AI, text generation.


Project Structure

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

Requirements

  • Python 3.8+
  • Pip

Installation

  1. Clone the repository:

    git clone https://github.com/JagoScript/erudite-be
    cd erudite-be
  2. Create and activate a virtual environment:

    python -m venv venv
    venv\Scripts\activate  # On Linux: source venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt

Running the API

  1. Start the API:
    python run.py

API Endpoints

POST /generate

Generates text based on a given prompt.

  • Request Body:
    {
      "prompt": "Your input prompt here"
    }

Testing

  1. Run Unit Tests:
    pytest

Customization

  • Model Configuration: Update app/core/config.py to change the default language model.
  • Add New Endpoints: Define additional routes in app/api/endpoints.py and corresponding logic in app/services/.

Acknowledgments


License

MIT License. See LICENSE for details.

About

API of Erudite AI

Topics

Resources

License

Stars

Watchers

Forks

Languages