#language-model #serde #model-language #gpt #model-enum

language-model-type

A Rust crate providing an enumeration for various language model types used in machine learning applications, enabling precise model specification through enums

6 releases

Uses new Rust 2024

0.1.5 Nov 30, 2025
0.1.4 Nov 30, 2025
0.1.3 Jul 13, 2025
0.1.2 Jun 20, 2025
0.1.1 Mar 31, 2025

#22 in #model-language

Download history 231/week @ 2025-12-10 289/week @ 2025-12-17 260/week @ 2025-12-24 200/week @ 2025-12-31 117/week @ 2026-01-07 282/week @ 2026-01-14 168/week @ 2026-01-21 186/week @ 2026-01-28 244/week @ 2026-02-04 66/week @ 2026-02-11 148/week @ 2026-02-18 153/week @ 2026-02-25 119/week @ 2026-03-04 135/week @ 2026-03-11 183/week @ 2026-03-18 179/week @ 2026-03-25

616 downloads per month
Used in 120 crates (5 directly)

MIT license

67KB
515 lines

language-model-type

language-model-type is a Rust crate providing an enumeration of supported language model types. It abstracts the identification of models such as GPT-3.5 Turbo, GPT-4 variations, and forthcoming O1 models within Rust applications. This facilitation enables developers to specify language model versions with precision, enhancing code readability and maintainability.

Features

  • Enumeration of Models: The LanguageModelType enum includes variants for models like Gpt3.5Turbo, Gpt4o, Gpt4oMini, Gpt4Turbo, O1Preview, O1Mini, and O1.
  • Serialization Support: Uses Serde with lowercase renaming for seamless serialization and deserialization.
  • Display Implementation: Custom fmt::Display trait implementation transforming enum to its respective string representation.

Installation

Add language-model-type to your Cargo.toml:

[dependencies]
language-model-type = "0.1.0"

Usage

Import and utilize LanguageModelType in your projects:

use language_model_type::LanguageModelType;

fn main() {
    let model = LanguageModelType::Gpt3_5Turbo;
    println!("Using model: {}", model);
}

This demonstrates the enum's application in selecting and displaying a language model type. Each variant maps to a corresponding string identifier used in practical settings.

Author

Developed by klebs (<klebs tpk3.mx@gmail.com>).

License

Licensed under the MIT License.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.


Note: This README.md file was generated by an AI model and may not be 100% accurate. However, it strives to provide accurate and helpful information.

Dependencies

~28–50MB
~696K SLoC