| Title: | Native 'torch' Inference for Limite Mathematical Language Models |
|---|---|
| Description: | Implements the Limite mathematical language-model architecture <https://github.com/paradigma-inc/limite-violetto> directly with 'torch'. Loads the published Base, Base Soup, and Violetto 'safetensors' checkpoints and tokenizers from the 'Hugging Face' Hub without a Python runtime or model-serving process. Provides cached autoregressive generation and the official single-turn prompt format used by the math-specialized Violetto checkpoint. |
| Authors: | Sounkou Mahamane Toure [aut, cre], Paradigma contributors [ctb, cph] (Limite architecture) |
| Maintainer: | Sounkou Mahamane Toure <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.1.0 |
| Built: | 2026-09-22 19:31:14 UTC |
| Source: | https://github.com/sounkou-bioinfo/Rlimite |
Construct a Limite language model
limite(config = limite_config())limite(config = limite_config())
config |
A configuration produced by |
A torch::nn_module implementing LimiteForCausalLM.
Violetto is intended for direct, independent mathematical problems rather than general multi-turn assistant use.
limite_chat(model, messages, tokenizer = limite_tokenizer(), ...)limite_chat(model, messages, tokenizer = limite_tokenizer(), ...)
model |
A pretrained Limite model. |
messages |
Conversation messages accepted by |
tokenizer |
A tokenizer returned by |
... |
Arguments passed to |
A scalar response string with generated token IDs attached as the
token_ids attribute.
Adds the Limite end-of-text and ChatML control tokens. A default system message is inserted when the first message is not a system message.
limite_chat_prompt(messages, add_generation_prompt = TRUE)limite_chat_prompt(messages, add_generation_prompt = TRUE)
messages |
A list of messages. Each message contains scalar |
add_generation_prompt |
Append the assistant prefix. |
A scalar prompt string.
Returns the model identifiers and immutable revisions covered by Rlimite's real-model tests. Violetto is the math-specialized single-turn solver; Base and Base Soup are published family checkpoints.
limite_checkpoints()limite_checkpoints()
A data frame with checkpoint labels, model identifiers, revisions, and profiles.
Creates the architecture contract used by the published 1B checkpoints. Values can be overridden to construct smaller models for experiments.
limite_config(...)limite_config(...)
... |
Named configuration overrides. |
A validated Limite configuration list.
Construct Limite from checkpoint configuration
limite_from_config(identifier, revision = "main", local_files_only = FALSE)limite_from_config(identifier, revision = "main", local_files_only = FALSE)
identifier |
Model identifier or local path. |
revision |
Hugging Face revision. |
local_files_only |
If |
An uninitialized Limite model with the requested architecture.
The model is created on the meta device and then attached to the checkpoint tensors, avoiding a second initialized copy of the 1B parameters.
limite_from_pretrained( identifier = "paradigma-inc/limite-1b-violetto", revision = "main", local_files_only = FALSE, device = NULL )limite_from_pretrained( identifier = "paradigma-inc/limite-1b-violetto", revision = "main", local_files_only = FALSE, device = NULL )
identifier |
Model identifier or local path. |
revision |
Hugging Face revision. |
local_files_only |
If |
device |
Optional torch device such as |
A pretrained Limite model in evaluation mode.
Public token IDs follow the zero-based Hugging Face convention. The model uses a key/value cache after the prompt prefill.
limite_generate( model, input_ids, max_new_tokens = 64L, temperature = 0.8, top_k = 50L, eos_token_id = model$config$eos_token_id, seed = NULL, include_prompt = FALSE, callback = NULL )limite_generate( model, input_ids, max_new_tokens = 64L, temperature = 0.8, top_k = 50L, eos_token_id = model$config$eos_token_id, seed = NULL, include_prompt = FALSE, callback = NULL )
model |
A model returned by |
input_ids |
Zero-based token IDs for one prompt. |
max_new_tokens |
Maximum number of tokens to generate. |
temperature |
Sampling temperature. Use zero for greedy decoding. |
top_k |
Number of highest-scoring tokens retained for sampling, or
|
eos_token_id |
Zero-based end token. Defaults to the model config. |
seed |
Optional torch random seed. |
include_prompt |
Include the prompt IDs in the returned vector. |
callback |
Optional function called with each generated token ID. |
An integer vector of zero-based token IDs.
Loads safetensors directly as R torch tensors. identifier may be a Hugging
Face model identifier, a checkpoint directory, or one safetensors file.
limite_state_dict(identifier, revision = "main", local_files_only = FALSE)limite_state_dict(identifier, revision = "main", local_files_only = FALSE)
identifier |
Model identifier or local path. |
revision |
Hugging Face revision. |
local_files_only |
If |
A named list of torch tensors.
Load the Limite tokenizer
limite_tokenizer( identifier = "paradigma-inc/limite-1b-violetto", revision = "main", local_files_only = FALSE )limite_tokenizer( identifier = "paradigma-inc/limite-1b-violetto", revision = "main", local_files_only = FALSE )
identifier |
Model identifier or local path. |
revision |
Hugging Face revision. |
local_files_only |
If |
A tok_tokenizer.