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

Separate python bindings #153

Open
torymur opened this issue Jan 28, 2025 · 0 comments
Open

Separate python bindings #153

torymur opened this issue Jan 28, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@torymur
Copy link
Contributor

torymur commented Jan 28, 2025

Repository needs to be restructured and python bindings to be separated from the core rust interfaces, which are currently all mixed and tied together, difficult to extend and support and make separate decisions about them.

Python bindings need to be in new bindings/python directory with their own set of dependencies and relevant python logic and tooling, with their own Cargo.*, .gitignore, pyproject, setup.*, Makefile, etc. Since python bindings can be considered as a built artifact, we also need to consider keeping Cargo.lock in git for reproducible builds. If this will be decided upon, then we would want to make certain adjustments in github workflows to test outside locked dependencies too and maybe add some other adjustments: #139 (comment)

To achieve that:

  1. Logic in core rust interfaces and in python bindings needs to be adapted
  2. Python benchmarks and tests moved too
  3. Interfaces of python bindings split into src: guide.rs, index.rs, vocabulary.rs files, with python interfaces in py_src/outlines_core
  4. Benchmarks, tests, all github workflows updated and tested

The 1)-3) work was attempted to be done as part of this PR: #143
But it requires a lot of adjustments and many separate improvements on 4), that it wasn't finished and could be considered a showcase of direction: https://github.com/dottxt-ai/outlines-core/tree/python-bindings-separation-example-do-not-delete

However, there is a lot of work needs to be done in 4) and to make it easier, I would suggest, that these issues will be tackled first:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant