Documentation
This guide will help you get started with contributing to Opik's documentation.
Documentation Structure
Section titled “Documentation Structure”This guide covers how to contribute to the two main parts of Opik's documentation: This Documentation Website: Built with Fern and Python SDK Reference Documentation: Built with Sphinx.
Here's how you can work with either one:
Contributing to this Documentation Website (Fern)
This website (source in apps/opik-documentation/documentation) is where our main guides, tutorials, and conceptual documentation live.
1. Install Prerequisites
Ensure you have Node.js and npm installed. You can follow the official guide here.
2. Set up Locally
Bash cd apps/opik-documentation/documentation # Install dependencies - Only needs to be run once npm install # Optional - Install Python dependencies if updating Jupyter Cookbooks pip install -r requirements.txt # Run the documentation website locally npm run devAccess the local site at
http://localhost:3000. Changes will update in real-time.3. Make Your Changes
Update content primarily in:
fern/docs-v2/: Main markdown content (like this page)./docs/cookbook: Source Jupyter Notebooks for the cookbook examples. These are not converted automatically — if you change a notebook, update the matchingfern/docs-v2/**/*.mdxpage in the same PR to keep the published page in step.
Refer to the
docs.ymlfile for the overall structure and navigation.4. Submitting Changes
Once you're happy with your changes, commit them and open a Pull Request against the
mainbranch of thecomet-ml/opikrepository.
Contributing to the Python SDK Reference Documentation (Sphinx)
The Python SDK reference docs (source in apps/opik-documentation/python-sdk-docs) are generated from docstrings in the Python codebase using Sphinx.
1. Install Prerequisites
Ensure you have Python and pip installed. A virtual environment is highly recommended.
2. Set up Locally
Bash cd apps/opik-documentation/python-sdk-docs # Install dependencies - Only needs to be run once pip install -r requirements.txt # Run the python sdk reference documentation locally make devAccess the local site at
http://127.0.0.1:8000. Changes will update in real-time as you modify docstrings in the SDK (sdks/python) and rebuild.3. Making Changes
Improvements to the SDK reference usually involve updating the Python docstrings directly in the SDK source files located in the
sdks/pythondirectory.4. Building and Previewing
After editing docstrings, run
make dev(ormake htmlfor a one-time build) in theapps/opik-documentation/python-sdk-docsdirectory to regenerate the HTML and preview your changes.5. Submitting Changes
Commit your changes to both the Python SDK source files and any necessary updates in the
python-sdk-docsdirectory. Open a Pull Request against themainbranch.