Unofficial python bindings for the rust llm library. 🐍❤️🦀

Overview

llm-rs-python: Python Bindings for Rust's llm Library

Welcome to llm-rs, an unofficial Python interface for the Rust-based llm library, made possible through PyO3. Our package combines the convenience of Python with the performance of Rust to offer an efficient tool for your machine learning projects. 🐍 ❤️ 🦀

With llm-rs, you can operate a variety of Large Language Models (LLMs) including LLama and GPT-NeoX directly on your CPU.

For a detailed overview of all the supported architectures, visit the llm project page.

Installation

Simply install it via pip: pip install llm-rs

Usage

The package is type-hinted for easy usage.

A Llama model can be run like this:

from llm_rs import Llama

#load the model
model = Llama("path/to/model.bin")

#generate
print(model.generate("The meaning of life is"))

Documentation

For in-depth information on customizing the loading and generation processes, refer to our detailed documentation.

You might also like...
Rust bindings for libjuice. Look at datachannel-rs if you need more batteries.

Rust bindings for libjuice. Look at datachannel-rs if you need more batteries.

GGML bindings that aim to be idiomatic Rust rather than directly corresponding to the C/C++ interface

rusty-ggml GGML bindings that aim to be idiomatic Rust rather than directly corresponding to the C/C++ interface. GG-what? See: https://github.com/gge

Rust bindings to llama.cpp, using metal on macOS

llama-rs Rust bindings to llama.cpp, for macOS, with metal support, for testing and evaluating whether it would be worthwhile to run an Llama model lo

High-level, optionally asynchronous Rust bindings to llama.cpp

llama_cpp-rs Safe, high-level Rust bindings to the C++ project of the same name, meant to be as user-friendly as possible. Run GGUF-based large langua

A highly modular Bitcoin Lightning library written in Rust. Its Rust-Lightning, not Rusty's Lightning!

Rust-Lightning is a Bitcoin Lightning library written in Rust. The main crate, lightning, does not handle networking, persistence, or any other I/O. Thus, it is runtime-agnostic, but users must implement basic networking logic, chain interactions, and disk storage. More information is available in the About section.

Rust library that can be reset if you think it's slow

GoodbyeKT Rust library that can be reset if you think it's slow

Notion Offical API client library for rust

Notion API client library for rust.

Rust library for program synthesis of string transformations from input-output examples 🔮

Synox implements program synthesis of string transformations from input-output examples. Perhaps the most well-known use of string program synthesis in end-user programs is the Flash Fill feature in Excel. These string transformations are learned from input-output examples.

SE3 Rust library for Robotics

Algebraic Robots A small Rust Library for SE3 Supported: Twist Screw SE3 Group se3 algebra Adjoint SE3 Twist Chains Wrenches Future plans: Jacobians V

Releases(0.2.1)
  • 0.2.1(May 19, 2023)

  • 0.2.0(May 19, 2023)

  • 0.1.1(May 8, 2023)

    Added the tokenize and decode functions to each model, to enable access to the internal tokenizer.

    The generation of tokens is now GIL free, meaning other background threads can run at the same time.

    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(May 3, 2023)

    Since llama-rs was renamed to llm and now supports multiple model architectures, this wrapper was also expanded to support the new trait system and library structure.

    Supported architectures for now:

    • Llama
    • GPT2
    • GPTJ
    • GPT-NeoX
    • Bloom

    The loader was also reworked and now supports the mmap-able ggjt. To support this the SessionConfig was expandend with the prefer_mmap field.

    Source code(tar.gz)
    Source code(zip)
Owner
Lukas Kreussel
Lukas Kreussel
Unofficial Bitwarden compatible server written in Rust, formerly known as bitwarden_rs

Alternative implementation of the Bitwarden server API written in Rust and compatible with upstream Bitwarden clients*, perfect for self-hosted deploy

Daniel García 21.5k Jan 8, 2023
[Unofficial] Azure SDK for Rust

[Unofficial] Azure SDK for Rust This repository is for the development of the unofficial Azure SDK for Rust. It is unofficial because it is not yet su

Microsoft Azure 390 Dec 30, 2022
RusTTS is an unofficial Coqui TTS implementation

RusTTS RusTTS is an unofficial Coqui TTS implementation. Currently, only the YourTTS for VC has been implemented. So, feel free to contribute us to ma

Ho Kim 13 Sep 12, 2022
Extreme fast factor expression & computation library for quantitative trading in Python.

Extreme fast factor expression & computation library for quantitative trading in Python.

Weiyuan Wu 22 Dec 8, 2022
Who said python couldn't have nice errors?

potato Who said python couldn't have nice errors? Running git clone https://github.com/KittyBorgX/potato.git cd potato cargo build --release ./target/

Krishna Ramasimha 5 Jan 22, 2023
Rust bindings to Cloudflare Worker KV Stores using wasm-bindgen and js-sys.

worker-kv Rust bindings to Cloudflare Worker KV Stores using wasm-bindgen and js-sys

Zeb Piasecki 39 Dec 4, 2022
Rust bindings for the WebView2 COM APIs

webview2-rs Rust bindings for the WebView2 COM APIs Crates in this repo The root of this repo defines a virtual workspace in Cargo.toml which includes

Bill Avery 24 Dec 15, 2022
Rust bindings for the KING OF TIME API

Rust bindings for the KING OF TIME API Example Prints if you are at work or not at work. $ cargo run --example tc -- status Record the time you start

Idein Inc. 2 Oct 11, 2021
Rust bindings for the Mattermost API

mattermost_api Rust bindings for the Mattermost API Installing Add the latest version to your Cargo.toml. Using Docs link. Developing Building Require

Matt Boulanger 1 Feb 2, 2022
High-level PortMidi bindings and wrappers for Rust

High-level PortMidi bindings and wrappers for Rust

Philippe Delrieu 69 Dec 1, 2022