Skip to content

pearsonkyle/DocBuddy

Repository files navigation

Documentation Buddy

CI PyPI version Python versions License: MIT Downloads FastAPI

Add an AI assistant to your /docs page.

Installation

pip install docbuddy

Quick Start

from fastapi import FastAPI
from docbuddy import setup_docs

app = FastAPI()
setup_docs(app)  # replaces default /docs

That's it! Visit /docs

API Explorer Chat Interface
API Explorer Chat Interface with Tools
Workflow Panel LLM Settings
Workflow Panel LLM Settings

Features

  • 💬 Chat interface with full OpenAPI context
  • 🤖 LLM Settings panel with local providers (Ollama, LM Studio, vLLM, Custom)
  • 🔗 Tool-calling for API Requests
  • 🎨 Dark/light theme support

Using the Chat

Ask questions like:

  • "What endpoints are available?"
  • "Create a curl cmd for adding a new user"
  • "Ping health"

Enable tool calling in the settings to allow the assistant to make API requests on your behalf.

Standalone Mode

DocBuddy has a standalone webpage (e.g. hosted on GitHub Pages) that connects to any OpenAPI schema and LLM provider. However, due to browser security restrictions (CORS), if you want to use local LLMs, you must run DocBuddy locally instead of from GitHub Pages.

  1. Run python3 -m http.server 8080 from the repo root
  2. Visit in your browser http://localhost:8080/docs/index.html

LLM Settings

  1. Choose your local LLM provider (Ollama, LM Studio, vLLM, or Custom)
  2. Enter the API endpoint for your LLM (e.g. http://localhost:1234/v1 for LMStudio)
  3. Verify that the plugin can connect to your LLM provider and select a model from the drop down after.
  4. Enable tool calling if you want the assistant to make API requests on your behalf.

Some local LLM providers will require users to enable CORS in their API settings to allow the plugin to connect.

Demo Server

uvicorn examples.demo_server:app --reload --host 0.0.0.0 --port 3333

Development

pip install -e ".[dev]"

pytest tests/
pre-commit run --all-files

About

Add an AI assistant to your /docs page

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors