Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference Doc (semi-manual). #978

Merged
merged 3 commits into from
Jun 17, 2024
Merged

Reference Doc (semi-manual). #978

merged 3 commits into from
Jun 17, 2024

Conversation

marius-baseten
Copy link
Contributor

@marius-baseten marius-baseten commented Jun 14, 2024

🚀 What

Gernate truss-chains API reference page

💻 How

  • Add many in-code docstrings.
  • Use sphinx with autodoc to generate markdown.
  • Use a hacky plugin to make the generated markdown nicer in mintlify.
  • Manually edit the rest.
  • Create a patch file between the generated and edited version for reproduciblity.
  • Integrate as snippet in mintlify docs.

🔬 Testing

docs/snippets/chains/API-reference.mdx Outdated Show resolved Hide resolved
docs/snippets/chains/API-reference.mdx Outdated Show resolved Hide resolved
[example chainlet](https://github.com/basetenlabs/truss/blob/main/truss-chains/truss_chains/example_chainlet.py)
for more guidance on how to create subclasses.

## *class* `truss_chains.deploy.ChainService`
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be exposed in the docs? I feel like add_service and whatnot are all somewhat internal implementation details of the CLI, I don't know if we want to codify/expose these to the outside world in their current form at least.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I thought about this too.
The reason why ChainService is at all part of the docs is because it's the return value of the (public API) function deploy_remotely. But some of its methods must/should not be used by users.

It seems to me that this is actually a bit a leaky design and we should ideally have something like an internal ChjainServiceBuilder (with methods like add_service) and then convert that to a public ChainService which only has the methods relevant to users like predict - it would be quite a bit of refactoring work which I don't wanna prioritize right now.

We could as a patchy solution just un-document the methods not intended for public use or keep them, but add in the docstring that they are not intended for end-users.

What do you think is overall best?

@marius-baseten marius-baseten merged commit 4cceda1 into main Jun 17, 2024
4 checks passed
@marius-baseten marius-baseten deleted the marius/doc branch June 17, 2024 22:25
marius-baseten added a commit that referenced this pull request Jun 17, 2024
marius-baseten added a commit that referenced this pull request Jun 17, 2024
marius-baseten added a commit that referenced this pull request Jun 17, 2024
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.

2 participants