A lightweight API server that provides contextual information for Bible verses using AI models.
Bible Context Server is a FastAPI application that offers quick Bible verse context lookup through two different AI backends:
- Local Ollama server with Gemma 3 12B model
- Google Gemini API (requires API key)
For any given Bible reference (book, chapter, verse), the service returns:
- The verse content (NASB 1995 translation)
- Author information
- Approximate time of writing
- Brief contextual description
- Main themes
- Related verses (quotations and allusions)
- Fast API endpoints for Bible verse context lookup
- Support for local AI inference via Ollama
- Integration with Google Gemini API
- HTML response formatting with Markdown support
- Python 3.13+
- Ollama server running locally with Gemma 3 12B model (for
/ol/endpoint) - Google Gemini API key (for
/ggl/endpoint)
- Clone the repository:
git clone https://github.com/yourusername/bible-context-server.git
cd bible-context-server- Set up a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate- Install dependencies:
pip install fastapi uvicorn requests markdown google-generativeai python-dotenv- Create a
.envfile in the project root with your Google Gemini API key:
GEMINI_API_KEY=your_api_key_here
-
Start the Ollama server locally (if using the
/ol/endpoint) -
Run the FastAPI server:
uvicorn server:app --reload- Access the API endpoints:
- Ollama endpoint:
http://localhost:8000/ol/{book_chapter_verse} - Gemini endpoint:
http://localhost:8000/ggl/{book_chapter_verse}
- Ollama endpoint:
Example:
http://localhost:8000/ol/John 3:16
http://localhost:8000/ggl/Romans 8:28
Uses a local Ollama server with the Gemma 3 12B model to provide Bible verse context.
Uses the Google Gemini API to provide Bible verse context. Requires a valid API key in the .env file.
The project is built with:
- FastAPI - Modern, fast web framework
- Ollama - Run large language models locally
- Google Generative AI - Google's Gemini API
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request

