Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Sleipnir

C++ Python PyPI Downloads Website C++ API Python API Discord

Sleipnir is a reverse mode autodiff library, interior-point method, and NLP solver DSL for C++23 and Python. The DSL automatically chooses the best solver based on the problem structure.

#include <print>

#include <sleipnir/optimization/problem.hpp>

int main() {
  // Find the x, y pair with the largest product for which x + 3y = 36
  slp::Problem<double> problem;

  auto x = problem.decision_variable();
  auto y = problem.decision_variable();

  problem.maximize(x * y);
  problem.subject_to(x + 3 * y == 36);
  problem.solve();

  // x = 18.0, y = 6.0
  std::println("x = {}, y = {}", x.value(), y.value());
}
#!/usr/bin/env python

from sleipnir.optimization import Problem


def main():
    # Find the x, y pair with the largest product for which x + 3y = 36
    problem = Problem()

    x, y = problem.decision_variable(2)

    problem.maximize(x * y)
    problem.subject_to(x + 3 * y == 36)
    problem.solve()

    # x = 18.0, y = 6.0
    print(f"x = {x.value()}, y = {y.value()}")


if __name__ == "__main__":
    main()

Sleipnir supports easy cross-compilation via CMake toolchain files, provides good performance by default, and contains clean reference implementations of various solvers with links to explanatory material.

The C++ API also supports arbitrary scalar types, so users can specify higher precision floating-point types at the cost of speed.

Install

The following platforms are supported:

  • Windows
  • Linux
    • OS: Ubuntu 24.04
    • Runtime: GCC 14 libstdc++ (run sudo apt install g++-14)
  • macOS
    • OS: macOS 14.5
    • Runtime: Apple Clang 16.0.0 libc++ from Xcode 16.2 (run xcode-select --install)

To use Sleipnir within a CMake project, add the following to CMakeLists.txt:

include(FetchContent)

FetchContent_Declare(
    Sleipnir
    GIT_REPOSITORY https://github.com/SleipnirGroup/Sleipnir.git
    GIT_TAG main
    EXCLUDE_FROM_ALL
    SYSTEM
)
FetchContent_MakeAvailable(Sleipnir)

target_link_libraries(MyApp PUBLIC Sleipnir::Sleipnir)

To use Sleipnir in Python, install sleipnirgroup-jormungandr from PyPI:

pip install sleipnirgroup-jormungandr

If necessary, follow these instructions to build from source.

Docs

See the C++ API docs, Python API docs, and usage docs.

Examples

See the examples folder, C++ optimization unit tests, and Python optimization unit tests.

Benchmarks

See the benchmarks folder.

Contributing

See the contributing docs.

Metadata

Release files for sleipnirgroup-jormungandr 0.6.7.dev61

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sleipnirgroup-jormungandr 0.6.7.dev61
File Size Uploaded
sleipnirgroup_jormungandr-0.6.7.dev61.tar.gz 137.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for sleipnirgroup-jormungandr 0.6.7.dev61
File
sleipnirgroup_jormungandr-0.6.7.dev61-cp312-abi3-win_arm64.whl CPython 3.12 abi3 Windows ARM64 Details
sleipnirgroup_jormungandr-0.6.7.dev61-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
sleipnirgroup_jormungandr-0.6.7.dev61-cp312-abi3-manylinux_2_39_x86_64.whl CPython 3.12 abi3 Linux glibc 2.39+ x86-64 Details
sleipnirgroup_jormungandr-0.6.7.dev61-cp312-abi3-manylinux_2_39_aarch64.whl CPython 3.12 abi3 Linux glibc 2.39+ ARM64 Details
sleipnirgroup_jormungandr-0.6.7.dev61-cp312-abi3-macosx_14_0_universal2.whl CPython 3.12 abi3 macOS 14.0+ universal2 (ARM64, x86-64) Details

Total release size: 4.2 MB

Release files / sleipnirgroup_jormungandr-0.6.7.dev61.tar.gz

Download URL sleipnirgroup_jormungandr-0.6.7.dev61.tar.gz
Size 137.2 kB
Tags Source
SHA-256 checksum
How to use checksums
51aa56fac9c9b144792093539d926e112765c0d26a21464634f21e2a8c3621bd
BLAKE2b-256 checksum
How to use checksums
86cf3358af82ae8d2d63d71c8c9a01287e7256fea1d8d398ee30cf83e6127774
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / sleipnirgroup_jormungandr-0.6.7.dev61-cp312-abi3-win_arm64.whl

Download URL sleipnirgroup_jormungandr-0.6.7.dev61-cp312-abi3-win_arm64.whl
Size 1.1 MB
Tags CPython 3.12 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
a84361b6a365db814e17186239e655fd0245123bc34404f2706809d06249d4b9
BLAKE2b-256 checksum
How to use checksums
c66528e9732269625696de53cc5a1de474cb79bf9a18baf7b1134a79395a9952
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / sleipnirgroup_jormungandr-0.6.7.dev61-cp312-abi3-win_amd64.whl

Download URL sleipnirgroup_jormungandr-0.6.7.dev61-cp312-abi3-win_amd64.whl
Size 902.2 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
51c2ef08c67891e7fdca037d27a8cbf2b6ed0383529a198a4fbce0d2b8502fba
BLAKE2b-256 checksum
How to use checksums
bf787e25133a33e974d2e3bab250a66383a2e2908348ddd847cb8e5831441c4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / sleipnirgroup_jormungandr-0.6.7.dev61-cp312-abi3-manylinux_2_39_x86_64.whl

Download URL sleipnirgroup_jormungandr-0.6.7.dev61-cp312-abi3-manylinux_2_39_x86_64.whl
Size 562.6 kB
Tags CPython 3.12 Linux glibc 2.39+ x86-64 abi3
SHA-256 checksum
How to use checksums
6778863b7f49bbd2625b104f83678cf38e340b6be58884d1e5566fbcc489db8c
BLAKE2b-256 checksum
How to use checksums
ee38488fcc5aeca65ef8dd04b518bf087297223c2d54f79fc3af11a1f483192c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / sleipnirgroup_jormungandr-0.6.7.dev61-cp312-abi3-manylinux_2_39_aarch64.whl

Download URL sleipnirgroup_jormungandr-0.6.7.dev61-cp312-abi3-manylinux_2_39_aarch64.whl
Size 509.1 kB
Tags CPython 3.12 Linux glibc 2.39+ ARM64 abi3
SHA-256 checksum
How to use checksums
619189cb59c1812b1e2cfa4eb0c5c73ed03f32786ee01850e77ed20d6eb138ac
BLAKE2b-256 checksum
How to use checksums
d9e6f9a47cd7e80a29d9ae5d4e06f1b249dc98adb9214ef44ba26667cc347313
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / sleipnirgroup_jormungandr-0.6.7.dev61-cp312-abi3-macosx_14_0_universal2.whl

Download URL sleipnirgroup_jormungandr-0.6.7.dev61-cp312-abi3-macosx_14_0_universal2.whl
Size 1.1 MB
Tags CPython 3.12 abi3 macOS 14.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
ec2027f65c6517d6e252d4cf52cc8f91ca100d6b32931816fedeeeb751dc69c1
BLAKE2b-256 checksum
How to use checksums
aac15558b9ae88582fe82019a186e3e4ec6c35414cc9e7f0d468aa929d82bf13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.7.dev61 This release

6 release files

0.6.6

6 release files

0.6.5

6 release files

0.6.4

6 release files

0.6.3

6 release files

0.6.2

6 release files

0.6.1

6 release files

0.6.0

6 release files

0.5.5

6 release files

0.5.4

6 release files

0.5.3

6 release files

0.5.2

6 release files

0.5.1

6 release files

0.5.0

6 release files

0.4.0

6 release files

0.3.5

6 release files

0.3.4

6 release files

0.3.3

6 release files

0.3.2

6 release files

0.3.1

6 release files

0.3.0

6 release files

0.2.2

6 release files

0.2.1

6 release files

0.2.0

6 release files

0.1.0

12 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page