#language-model #llm #ai #api-client #api-bindings #aleph-alpha

aleph-alpha-client

Interact with large language models provided by the Aleph Alpha API in Rust code

17 unstable releases (6 breaking)

0.7.1 Nov 30, 2023
0.7.0 Jul 26, 2023
0.6.1 Jul 4, 2023
0.5.4 Feb 27, 2023
0.4.0 Oct 29, 2022

#147 in Machine learning

Download history 7/week @ 2023-12-30 31/week @ 2024-01-06 51/week @ 2024-01-13 48/week @ 2024-01-20 41/week @ 2024-01-27 42/week @ 2024-02-03 47/week @ 2024-02-10 172/week @ 2024-02-17 142/week @ 2024-02-24 134/week @ 2024-03-02 174/week @ 2024-03-09 248/week @ 2024-03-16 142/week @ 2024-03-23 179/week @ 2024-03-30 192/week @ 2024-04-06

773 downloads per month

MIT license

1.5MB
827 lines

Aleph Alpha API client for Rust

Interact with large language models provided by the Aleph Alpha API in Rust code.

Usage

use aleph_alpha_client::{Client, TaskCompletion, How, Task};

#[tokio::main]
fn main() {
    // Authenticate against API. Fetches token.
    let client = Client::new("AA_API_TOKEN").unwrap();

    // Name of the model we we want to use. Large models give usually better answer, but are also
    // more costly.
    let model = "luminous-base";

    // The task we want to perform. Here we want to continue the sentence: "An apple a day ..."
    let task = TaskCompletion::from_text("An apple a day", 10);
    
    // Retrieve the answer from the API
    let response = client.completion(&task, model, &How::default()).await.unwrap();

    // Print entire sentence with completion
    println!("An apple a day{}", response.completion);
}

This is a work in progress currently the Rust client is not a priority on our Roadmap, so expect this client to be incomplete. If we work on it expect interfaces to break.

Dependencies

~17–31MB
~321K SLoC