[Inference doc] Next gen inference snippets #1643
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Opening this PR as a draft as it'll requires some deeper changes in doc-builder cc @julien-c @gary149 @mishig25 @SBrandeis @hanouticelina
This PR updates the script to generate the tasks pages of the Inference API docs (e.g. text-to-image page). The short-term goal is to revamp the "Inference API" docs as an "Inference Providers" one, making them more provider-centric. With this PR, each task page will have
<inferencesnippets>
tag to have an interface similar to the one on the model pageWhat I did in this PR is to generate the snippets and serialize them inside some
<snippet provider="..." language="..." client="...">
tags. This is where doc-builder should be updated to take them into account.New
<inferencesnippet>
format:to be discussed further, we can make the format evolve...
Side note: it has also been quickly discussed to integrate the model page modal directly as an iframe inside the docs to minimize changes. However we concluded that serializing all the snippets in markdown will be much more powerful for LLM-first documentation (e.g. AI Agent-readable documentation). The iframe solution would only work for user browsing the documentation manually .