Skip to content

Add API docs GH page and README updates#10

Merged
cretz merged 4 commits into
mainfrom
cretz/api-docs
Jun 8, 2026
Merged

Add API docs GH page and README updates#10
cretz merged 4 commits into
mainfrom
cretz/api-docs

Conversation

@cretz

@cretz cretz commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

🚀 What

Need API docs hosted on GH pages (we did some sphinx hacking to get it right). We chose to publish on each main merge instead of each release.

Also updated README with pypi badge and adjust pyproject.toml to include Python version classifiers so we can add that pypi+pyversion badge after next release.

💻 How

Sphinx doc gen and publish on main merge. Also some README and pyproject updates.

🔬 Testing

Had workflow run as part of this PR before reverting that trigger. Can see docs at https://basetenlabs.github.io/baseten-python/.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds automated API documentation generation and publishing to GitHub Pages, along with minor packaging/readme metadata updates to better surface docs and PyPI status.

Changes:

  • Introduces a scripts.docgen module that builds pydoctor HTML docs into _site/ for GitHub Pages publishing.
  • Adds a GitHub Actions workflow to generate and deploy the docs site.
  • Updates project metadata (Python version classifiers, dev dependency) and README (PyPI badge + API docs link), and ignores _site/.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
uv.lock Locks new dev/doc tooling dependencies (pydoctor and transitive deps).
scripts/docgen/__main__.py Implements pydoctor-based doc generation into _site/api with a root redirect.
README.md Adds PyPI badge and links to hosted API docs.
pyproject.toml Adds Python version classifiers, adds pydoctor to dev deps, and adds poe task for doc generation.
.gitignore Ignores _site build output.
.github/workflows/docs.yml Builds and deploys _site to GitHub Pages on main updates (per workflow intent).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/docs.yml
@cretz cretz temporarily deployed to github-pages June 8, 2026 17:15 — with GitHub Actions Inactive
@cretz cretz force-pushed the cretz/api-docs branch from 7358ade to b2a4511 Compare June 8, 2026 17:18
@cretz cretz marked this pull request as ready for review June 8, 2026 17:19
Comment thread README.md Outdated
Python SDK for Baseten.
[![PyPI](https://img.shields.io/pypi/v/baseten.svg)](https://pypi.org/project/baseten/)

Python SDK for Baseten. See the [API documentation](https://basetenlabs.github.io/baseten-python/api/) and [usage](#usage) below.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked this link. Two thoughts here:

  • I never liked mintlify much because of really weak capabilities to display generated lib docs well. I fiddled quite a bit around with it to get something close for chains, specifically, like https://docs.baseten.co/reference/sdk/chains (it sphinx with markdown output and "adatpation" for mintlify mdx... 🤦 ). But liking it or not, I have mixed feelings about "splicing" docs to a totally different location and format. Is there any discussion e.g. with @pat-baseten about this on what our overall strategy is?
  • These docs don't look very nice. RTD theme is what I'm used to see for many "nice" python docs, any chanc we can use this here?

@cretz cretz Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never liked mintlify much because of really weak capabilities to display generated lib docs well

I am not looking for general purpose docs, those will be at docs.baseten.co one day, I need pure API docs and not too concerned with the details of the API docs but we can move them if needed. Definitely don't want Sphinx/RTD style for just the types.

https://docs.baseten.co/reference/sdk/chains

This is exactly what I was trying to avoid, the Sphinx/RTD-style docs that are more prose than API reference and leave a lot to be desired for those looking for quick API reference (not to be confused with actual usage docs which we do not want to mash into the API docs here since most are generated). Notice how you can't even see the things at a glance, it's mashed into one page, space is wasted by English content and whitespace, etc? That lib's API surface is probably about tenth of the size of these docs and is less navigable.

There are dozens and dozens of classes in this doc. I just need some javadoc/rustdoc API style docs that properly link across and without the prose part expected to accompany RTD stuff. That's why I have pydoctor and hosted them at api/ knowing that actual docs will never be here.

If the pure API doc reference as seen here is not acceptable, I can remove this PR if I must, but definitely not looking to make/host full Sphinx/RTD-style API documentation just to see the entire auto-generated Python API at a glance (e.g. https://basetenlabs.github.io/baseten-python/api/baseten.client.managementapi.ApiClient.html similar to https://pkg.go.dev/github.com/basetenlabs/baseten-go@main/client/managementapi).

For comparison to other similarly-OpenAPI-generated docs, can see Anthropic doesn't even document each method/type (see https://platform.claude.com/docs/en/api/sdks/python) and OpenAI just dumped into a single markdown (https://github.com/openai/openai-python/blob/main/api.md). Neither would have put these in Sphinx for this generated surface, yet both still make it hard to see all types.

@cretz cretz Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I put in the extra time here to get the Sphinx docs to look API-docs-ish (e.g. class per page, left nav trimming, etc) and so I switched over to Sphinx. Not sure I want to do much more here since most of the things are generated code.

Can review at https://basetenlabs.github.io/baseten-python/

@cretz cretz temporarily deployed to github-pages June 8, 2026 20:20 — with GitHub Actions Inactive
@cretz cretz requested a review from marius-baseten June 8, 2026 20:22
@cretz cretz merged commit 8454a91 into main Jun 8, 2026
4 checks passed
@cretz cretz deleted the cretz/api-docs branch June 8, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants