Add architecture documentation to the Guide section#1797
Add architecture documentation to the Guide section#1797RobinPicard merged 4 commits intodottxt-ai:mainfrom
Conversation
RobinPicard
left a comment
There was a problem hiding this comment.
Thanks a lot for opening this PR! I've made a few comments and then stopped realizing they are all going in the same direction. I think we should create a document quite different from the llm.txt as they have different purposes; The latter includes content intended to "market" the library a bit, and is intended to be used independently of the rest of the documentation. In our case we want to do something to help an Outlines user understand better the organization of the library. So I believe the document should be more users-focused. A good example is the Generator, users should understand after reading the file why this abstraction was created for instance.
docs/guide/architecture.md
Outdated
| @@ -0,0 +1,161 @@ | |||
| # Architecture Overview | |||
|
|
|||
| This guide explains how Outlines works under the hood. Understanding the architecture helps contributors navigate the codebase and extend the library. | |||
There was a problem hiding this comment.
I would change and the section immediately below. It feels a bit off in this page
docs/guide/architecture.md
Outdated
|
|
||
| ## Core Components | ||
|
|
||
| ### Models (`outlines/models/`) |
There was a problem hiding this comment.
I would focus more on the Model and TypeAdapter classes: what role they play, the methods they implement, how they are used in other classes...
docs/guide/architecture.md
Outdated
| | `ollama.py` | Ollama integration | | ||
| | `llamacpp.py` | llama.cpp integration | | ||
|
|
||
| ### Generation (`outlines/generator.py`) |
There was a problem hiding this comment.
I think we should give more details here, it's hard to understand the point of this abstraction otherwise
|
@RobinPicard Thanks for your review. I realize there may be something wrong. I will re-check this pr. |
Add a human-readable architecture guide based on llm.txt content. The guide explains: - The layer stack from user API to token processing - Key design decisions - Core components and their responsibilities - How FSM compilation and token masking work - Extension points for adding models, constraints, and processors Fixes dottxt-ai#1705 Signed-off-by: majiayu000 <1835304752@qq.com>
Address review feedback from RobinPicard: - Remove marketing-style content from llm.txt - Add detailed explanation of Model and ModelTypeAdapter classes including their roles, methods, and usage patterns - Explain why Generator abstraction exists and what problem it solves - Add code examples showing the internal workings - Reorganize content around core abstractions rather than file structure - Add Data Flow section showing end-to-end request processing Signed-off-by: majiayu000 <1835304752@qq.com>
be25e0d to
34d2875
Compare
Summary
llm.txtcontentmkdocs.ymlChanges
The architecture guide explains:
Fixes #1705
Test plan