Skip to content

Add architecture documentation to the Guide section#1797

Merged
RobinPicard merged 4 commits intodottxt-ai:mainfrom
majiayu000:docs/add-architecture-guide
Jan 28, 2026
Merged

Add architecture documentation to the Guide section#1797
RobinPicard merged 4 commits intodottxt-ai:mainfrom
majiayu000:docs/add-architecture-guide

Conversation

@majiayu000
Copy link
Contributor

Summary

  • Add a human-readable architecture guide based on llm.txt content
  • Add the new page to the navigation in mkdocs.yml

Changes

The architecture guide explains:

  • The layer stack from user API to token processing
  • Key design decisions (FSM-based constraints, provider abstraction, lazy compilation, etc.)
  • Core components (models, generators, FSM system, type system, logits processors)
  • How FSM compilation and token masking work
  • Extension points for adding models, constraints, and processors

Fixes #1705

Test plan

  • Pre-commit checks pass
  • Documentation builds correctly (to be verified in CI)

Copy link
Contributor

@RobinPicard RobinPicard left a comment

Choose a reason for hiding this comment

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

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.

@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would change and the section immediately below. It feels a bit off in this page


## Core Components

### Models (`outlines/models/`)
Copy link
Contributor

Choose a reason for hiding this comment

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

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...

| `ollama.py` | Ollama integration |
| `llamacpp.py` | llama.cpp integration |

### Generation (`outlines/generator.py`)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should give more details here, it's hard to understand the point of this abstraction otherwise

@majiayu000
Copy link
Contributor Author

@RobinPicard Thanks for your review. I realize there may be something wrong. I will re-check this pr.

majiayu000 and others added 4 commits January 28, 2026 08:58
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>
@RobinPicard RobinPicard force-pushed the docs/add-architecture-guide branch from be25e0d to 34d2875 Compare January 28, 2026 07:58
@RobinPicard RobinPicard self-requested a review January 28, 2026 09:19
@RobinPicard RobinPicard merged commit fdb661f into dottxt-ai:main Jan 28, 2026
6 checks passed
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.

Add an architecture page in the docs

2 participants