diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build_documentation.yml deleted file mode 100644 index 7902c171..00000000 --- a/.github/workflows/build_documentation.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Build the documentation - -on: - pull_request: - branches: [main] - -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - name: Build the documentation - env: - GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }} - run: | - pip install -r requirements-doc.txt - mkdocs build diff --git a/.github/workflows/publish_documentation.yml b/.github/workflows/publish_documentation.yml deleted file mode 100644 index 4679121b..00000000 --- a/.github/workflows/publish_documentation.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Publish the documentation - -on: - push: - branches: - - main - -permissions: - contents: write - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: 3.x - - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV - - uses: actions/cache@v3 - with: - key: mkdocs-material-${{ env.cache_id }} - path: .cache - restore-keys: | - mkdocs-material- - - run: pip install -r requirements-doc.txt - - name: Build documentation - env: - GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }} - run: mkdocs gh-deploy --force diff --git a/docs/api/guide.md b/docs/api/guide.md deleted file mode 100644 index 1c3160c8..00000000 --- a/docs/api/guide.md +++ /dev/null @@ -1 +0,0 @@ -::: outlines.fsm.guide diff --git a/docs/api/index.md b/docs/api/index.md deleted file mode 100644 index b0d5c88f..00000000 --- a/docs/api/index.md +++ /dev/null @@ -1 +0,0 @@ -# API Reference diff --git a/docs/api/json_schema.md b/docs/api/json_schema.md deleted file mode 100644 index 471cb3a8..00000000 --- a/docs/api/json_schema.md +++ /dev/null @@ -1 +0,0 @@ -::: outlines.fsm.json_schema diff --git a/docs/api/models.md b/docs/api/models.md deleted file mode 100644 index 27ad297f..00000000 --- a/docs/api/models.md +++ /dev/null @@ -1,3 +0,0 @@ -::: outlines.models.transformers - -::: outlines.models.openai diff --git a/docs/api/parsing.md b/docs/api/parsing.md deleted file mode 100644 index e9662999..00000000 --- a/docs/api/parsing.md +++ /dev/null @@ -1 +0,0 @@ -::: outlines.fsm.parsing diff --git a/docs/api/prompts.md b/docs/api/prompts.md deleted file mode 100644 index 9d28f838..00000000 --- a/docs/api/prompts.md +++ /dev/null @@ -1 +0,0 @@ -::: outlines.prompts diff --git a/docs/api/regex.md b/docs/api/regex.md deleted file mode 100644 index 5ef91db4..00000000 --- a/docs/api/regex.md +++ /dev/null @@ -1 +0,0 @@ -::: outlines.generate.regex diff --git a/docs/api/samplers.md b/docs/api/samplers.md deleted file mode 100644 index 2b9b3423..00000000 --- a/docs/api/samplers.md +++ /dev/null @@ -1 +0,0 @@ -::: outlines.samplers diff --git a/docs/assets/images/dottxt.png b/docs/assets/images/dottxt.png deleted file mode 100644 index 1bdf8cb6..00000000 Binary files a/docs/assets/images/dottxt.png and /dev/null differ diff --git a/docs/assets/images/logits_processing_diagram.svg b/docs/assets/images/logits_processing_diagram.svg deleted file mode 100644 index 92668e6c..00000000 --- a/docs/assets/images/logits_processing_diagram.svg +++ /dev/null @@ -1,157 +0,0 @@ - - - - - diff --git a/docs/assets/images/logo.png b/docs/assets/images/logo.png deleted file mode 100644 index 9a9f234a..00000000 Binary files a/docs/assets/images/logo.png and /dev/null differ diff --git a/docs/assets/images/normal_computing.jpg b/docs/assets/images/normal_computing.jpg deleted file mode 100644 index a71483a6..00000000 Binary files a/docs/assets/images/normal_computing.jpg and /dev/null differ diff --git a/docs/blog/.authors.yml b/docs/blog/.authors.yml deleted file mode 100644 index c3fe2ac1..00000000 --- a/docs/blog/.authors.yml +++ /dev/null @@ -1,5 +0,0 @@ -authors: - remilouf: - name: Remi Louf - description: author - avatar: https://avatars.githubusercontent.com/u/3885044?v=4 diff --git a/docs/blog/assets/4000_stars.png b/docs/blog/assets/4000_stars.png deleted file mode 100644 index f3a596d7..00000000 Binary files a/docs/blog/assets/4000_stars.png and /dev/null differ diff --git a/docs/blog/index.md b/docs/blog/index.md deleted file mode 100644 index 05761ac5..00000000 --- a/docs/blog/index.md +++ /dev/null @@ -1 +0,0 @@ -# Blog diff --git a/docs/blog/posts/roadmap-2024.md b/docs/blog/posts/roadmap-2024.md deleted file mode 100644 index d1413b05..00000000 --- a/docs/blog/posts/roadmap-2024.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -date: 2024-01-10 -categories: - - Roadmap -authors: - - remilouf ---- - -# Roadmap for 2024 - -Outlines is not even one year old and it's already gone a long way! As we just reached 4000 stars, and before laying out the roadmap for the following year, we would like to pause and thank all of you for supporting us, using and contributing to the library! - -![4000 stars](../assets/4000_stars.png) - -## Thoughts - -Before delving into [the detailed roadmap](#detailed-roadmap), let me share a few thoughts and explain the general direction of the library. These thoughts are informed with my multiple interactions with users, either on [Twitter](https://twitter.com/remilouf) or in our [Discord server](https://discord.gg/ZxBxyWmW5n). - -*Outlines currently differentiates itself* from other libraries with its efficient JSON- and regex- constrained generation. A user-facing interface for grammar-structured generation (it had been hidden in the repository) was also recently added. But there is much more we can do along these lines. In 2024 will we will keep pushing in the direction of more accurate, faster constrained generation. - -Outlines also supports many models providers: `transformers`, `mamba`, `llama.cpp` and `exllama2`. Those *integrations represent a lot of maintenance*, and we will need to simplify them. For instance, `transformers` now supports quantized models, and we will soon deprecate the support for `autoawq` and `autogptq`. -Thanks to a refactor of the library, it is now possible to use our constrained generation method by using logits processor with all other libraries, except `mamba`. We will look for libraries that provide state-space models and allow to pass a logits processor during inference. We will interface with `llama.cpp` and `exllama2` using logits processors. - -*We would like expand our work to the whole sampling layer*, and add new sampling methods that should make structured generation more accurate. This means we will keep the `transformers` integration as it is today and will expand our text generation logic around this library. - -Making workflows re-usable and easy to share is difficult today. That is why *we are big believers in [outlines functions](https://github.com/outlines-dev/functions)*. We will keep improving the interface and adding examples. - -Finally, *we want to add a CLI tool*, `outlines serve`. This will allows you to either serve an API that does general constrained generation, or to serve Outlines function. - -## Detailed roadmap - -Here is a more detailed roadmap for the next 12 months. Outlines is a [community](https://discord.gg/ZxBxyWmW5n) effort, and we invite you to pick either topic and [contribute to the library](https://github.com/outlines-dev/outlines). I will progressively add related [issues](https://github.com/outlines-dev/outlines/issues) in the repository. - -### Many more examples and tutorials - -Let's be honest, Outlines is lacking clear and thorough examples. We want to change this! - -* How does Outlines work? What can you do with it? -* What can you do with Outlines that is harder or impossible to do with other libraries? -* How you can perform standard LLM workflows, for instance Chain of Thoughts, Tree of Thoughts, etc? -* How does Oultines integrates with the larger ecosystem, for instance other libraries like LangChain and LlamaIndex? - -### Simplify the integrations - -We want to keep the current integrations but lower the maintenance cost so we can focus on what we bring to the table. - -* Deprecate every obsolete integration: `transformers` has recently integrated `autoawq` and `autogptq` for instance. ([PR](https://github.com/outlines-dev/outlines/pull/527)) -* See if we can integrate to a library that provides state-space models via a logit processing function; -* Integrate with llama.cpp via a logits processor; -* Integrate with exllamav2 via a logits processor; - -### Push structured generation further - -We're just getting started! - -* Improve the performance of existing structured generation algorithms; -* Improve the correctness of structured generation algorithms; -* Add ready-to-use grammars in the [grammars](https://github.com/outlines-dev/grammars) repository or in a submodule in Outlines. - -### Keep developing Outlines functions - -Functions are awesome, use them! - -* Implement a CLI `outlines serve` that allows to serve Outlines functions locally; -* Add more functions to the [functions](https://github.com/outlines-dev/functions) repository. - -### Serve structured generation - -We want to make it easier to serve structured generation and outlines functions. - -* Implement the outlines serve CLI `outlines serve` - - Serve local APIs that perform structured generation; - - Serve Outlines functions. - -### Improve the generation layer - -* Use `transformers`'s private API to prepare inputs for generation inside the `Transformers` class; -* Support successions of model generation and text infilling for methods like Beam Search and SMC; -* Differentiate by adding new caching methods: attention sink, trie-based caching, etc; -* Differentiate by implementing SMC; -* Implement Beam Search; -* Add token healing. - -### A more seamless integration with OpenAI - -* Provide the same user interface for OpenAI and open source models so they are easily interchangeable; -* Integrate the function calling API. - -## Last word - -This roadmap was influenced by the expressed interests of the community. If it doesn't reflect your needs please come and [share your experience with us](https://discord.gg/ZxBxyWmW5n). diff --git a/docs/community/belonging.png b/docs/community/belonging.png deleted file mode 100644 index 7346f9ae..00000000 Binary files a/docs/community/belonging.png and /dev/null differ diff --git a/docs/community/contribute.md b/docs/community/contribute.md deleted file mode 100644 index d5568f47..00000000 --- a/docs/community/contribute.md +++ /dev/null @@ -1,132 +0,0 @@ ---- -title: Contribute ---- - -## What contributions? - -- **Documentation** contributions are very valuable to us! -- **Examples.** Show us what you did with Outlines :) -- **Bug reports** with a minimum working examples in the [issue tracker][issues] -- **Bug fixes** are always a pleasure to review. -- **New features**. Please start a new [discussion][discussions], or [come chat with us][discord] beforehand! - -Note that the [issue tracker][issues] is only intended for actionable items. In doubt, open a [discussion][discussions] or [come talk to us][discord]. - -## How to contribute? - -### Setup - -First, [fork the repository on GitHub](https://github.com/outlines-dev/outlines/fork) and clone the fork locally: - -```bash -git clone git@github.com/YourUserName/outlines.git -cd outlines -``` - -Create a new virtual environment. *If you are using conda*: - -```bash -conda env create -f environment.yml -``` - -*If you are using venv*: - -```python -python -m venv .venv -source .venv/bin/activate -``` - -Then install the dependencies in editable mode, and install the pre-commit hooks: - -```python -pip install -e ".[test]" -pre-commit install -``` - -### Before pushing your code - -Run the tests: - -```python -pytest -``` - -And run the code style checks: - -```python -pre-commit run --all-files -``` - -### Benchmarking - -Outlines uses [asv](https://asv.readthedocs.io) for automated benchmark testing. Benchmarks are run automatically before pull requests are merged to prevent performance degredation. - -You can run the benchmark test suite locally with the following command: -``` -asv run --config benchmarks/asv.conf.json -``` - -Caveats: -- If you're on a device with CUDA, you must add the argument `--launch-method spawn` -- Uncommitted code will not be benchmarked, you must first commit your changes. - -#### Run a specific test: -``` -asv run --config benchmarks/asv.conf.json -b bench_json_schema.JsonSchemaBenchmark.time_json_schema_to_fsm -``` - -#### Profile a specific test: -``` -asv run --config benchmarks/asv.conf.json --profile -b bench_json_schema.JsonSchemaBenchmark.time_json_schema_to_fsm -``` - -#### Compare to `origin/main` -``` -get fetch origin -asv continuous origin/main HEAD --config benchmarks/asv.conf.json -``` - -#### ASV PR Behavior - -- **View ASV Benchmark Results:** Open the workflow, view `BENCHMARK RESULTS` section. -- Merging is blocked unless benchmarks are run for the latest commit. -- Benchmarks fail if performance degrades by more than 10% for any individual benchmark. -- The "Benchmark PR" workflow runs when its manually dispatched, or if the `run_benchmarks` label is added to the PR they run for every commit. - - -### Contribute to the documentation - -To work on the *documentation* you will need to install the related dependencies: - -```python -pip install -r requirements-doc.txt -``` - -To build the documentation and serve it locally, run the following command in the repository's root folder: - -```python -mkdocs serve -``` - -By following the instruction you will be able to view the documentation locally. -It will be updated every time you make a change. - -## Open a Pull Request - -Create a new branch on your fork, commit and push the changes: - -```bash -git checkout -b new-branch -git add . -git commit -m "Changes I made" -git push origin new-branch -``` - -Then you can [open a pull request][pull-requests] on GitHub. It should prompt you to do so. Every subsequent change that you make on your branch will update the pull request. - -Do not hesitate to open a draft PR before your contribution is ready, especially if you have questions and/or need feedback. If you need help, come tell us on [Discord][discord]. - -[discord]: https://discord.gg/R9DSu34mGd -[discussions]: https://github.com/outlines-dev/outlines/discussions -[issues]: https://github.com/outlines-dev/outlines/issues -[pull-requests]: https://github.com/outlines-dev/outlines/pulls diff --git a/docs/community/examples.md b/docs/community/examples.md deleted file mode 100644 index 2ebaf276..00000000 --- a/docs/community/examples.md +++ /dev/null @@ -1,19 +0,0 @@ -# Community projects and articles - -Publishing examples and articles about Outlines are a meaningful way to contrinute to the community. Here is a list of projects we are aware of. Drop us a line if we forgot yours! - -[MMSG](https://github.com/leloykun/mmsg) is a Python library for generating interleaved text and image content in a structured format you can directly pass to downstream APIs. - -[Multimodal Structured Generation: CVPR's 2nd MMFM Challenge Technical Report](https://arxiv.org/abs/2406.11403) shows that Structured Generation can outperform finetuning, and maybe even multimodality, in document-image understanding tasks as part of CVPR's 2nd MMFM Challenge. - -[Chess LLM Arena](https://huggingface.co/spaces/mlabonne/chessllm) is a HuggingFace Space where you can make LLMs compete in a chess match. - -[LLM Data Gen](https://huggingface.co/spaces/lhoestq/LLM_DataGen) is a HuggingFace Space that generates synthetic dataset files in JSONLines format. - -[Fast, High-Fidelity LLM Decoding with Regex Constraints ](https://vivien000.github.io/blog/journal/llm-decoding-with-regex-constraints.html) presents an efficient alternative to Outlines's structured generation. - -[gigax](https://github.com/GigaxGames/gigax) is an Open-Source library that allows to create real-time LLM-powered NPCs for video games. - -[Improving Prompt Consistency with Structured Generations](https://huggingface.co/blog/evaluation-structured-outputs) shows how structured generation can improve consistency of evaluation runs by reducing sensitivity to changes in prompt format. - -[AskNews](https://asknews.app) is a news curation service processing 300k news articles per day in a structured way, with Outlines. diff --git a/docs/community/feedback.md b/docs/community/feedback.md deleted file mode 100644 index 94280954..00000000 --- a/docs/community/feedback.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: Feedback ---- - -# Feedback - -If Outlines has been helpful to you, let us know on [Discord][discord] or give us a shoutout on [Twitter][twitter]! It's always heartwarming ❤️ - - -
- - - - - - - -- -I am once again reminding you that structured extraction using LLMs is going to transform every single industry in the next 10 years https://t.co/xQ3tcWnrZ8
— Sam Hogan (@0xSamHogan) April 17, 2024
- -outline's growth is insane, using is an understatement! https://t.co/rHCNWhZdCs
— jason liu (@jxnlco) April 17, 2024
- -Outlines is an amazing lib and more popular than @remilouf’s modesty will admit. https://t.co/DfHbMPIlX1 https://t.co/mDHIWJrD0C
— Delip Rao e/σ (@deliprao) April 18, 2024
- -Impressive implementation of a true regex / json / grammar guided text generation pic.twitter.com/RX5RVYaVIx
— Rohan Paul (@rohanpaul_ai) December 30, 2023
- -Most underrated Github Repo in AI + LLM JSON guided Generation: https://t.co/lSB8KIet1H
— 🎙Jean-Louis Queguiner (@JiliJeanlouis) December 18, 2023
- -Nice and useful. https://t.co/LX72AE0lgt
— Dan Roy (@roydanroy) August 15, 2023
- -HUGE dub for open source AI https://t.co/bYKuiEUZ1j
— kenneth 🖇 (@k3nnethfrancis) August 15, 2023
- -This is amazing - glad to see more outp guidance modules!
— Hrishi (@hrishioa) August 14, 2023
Will try this out soon I'm wondering how they translate from regex automatons to token boundaries
Also why Open Source will succeed. Even today I don't see any guided output functionality from the big providers. https://t.co/Ity2H25Klf
- -Outlines 〰️- a library to help LLM developers guide text generation in a fast and reliable way.
— elvis (@omarsar0) August 14, 2023
"Provides generation methods that guarantee that the output will match a regular expressions, or follow a JSON schema."
Need to check this out. Reliable JSON output is a common use… pic.twitter.com/Bkbh8vKogN
- -Woah this is cool! Makes open source models more usable.
— Yohei (@yoheinakajima) August 14, 2023
Give any LLM Function Call capability (and more) with Outlines: https://t.co/PtPykR5ZGR https://t.co/RRQjWHnIxv pic.twitter.com/BwNnH8SMwv
- -This is awesome! Being able to guarantee the output's structure unblocks so many applications. This is a great milestone and a fundamental building block for more advanced AI apps. https://t.co/WdwMOc7hE8
— Guilherme Castro (@skastr052) August 15, 2023
- -Juggling with the unpredictable outputs of ChatGPT API lately while building my product. 😓
— Charlie (@14435635Sun) August 15, 2023
Tried prompt engineering to channel its wisdom into a neat JSON, but it's like asking a cat to fetch. 🐱
Luckily, stumbled upon "Outlines" – looks like a promising way to tame the LLM… pic.twitter.com/oYQ6q8exAS
-A complex system of LLM input-outputs interacting with non-LLM agents and models benefits immeasurably from structured outputs. The outlines package saves so much time, https://t.co/NhVQ6NpKDR
— Amir Sani (@amirsani) November 26, 2023