API Reference
This page is generated from exported docstrings in the package. It covers the stable package surface for configuration, bundle IO, checkpointing, generation, chat helpers, behavior scoring, and Flux/Lux backend entry points.
The v9 chatbot training scripts live under tools/ and are documented in the README and current chatbot docs rather than as exported package API.
KeemenaLM.Core.AbstractCausalLM — Type
Framework-neutral base type for decoder-only causal language models.
KeemenaLM.Core.AbstractModelConfig — Type
Framework-neutral base type for model configuration objects.
KeemenaLM.Core.Bundle — Type
In-memory bundle container used for save/load APIs.
KeemenaLM.Core.BundleManifest — Type
Bundle manifest for model package metadata.
KeemenaLM.Core.ChatSession — Type
Minimal in-memory chat wrapper around generate.
KeemenaLM.Core.GPT2Config — Type
Minimal GPT-2 style decoder configuration.
KeemenaLM.Core.GenerationConfig — Type
Configuration for text generation settings.
KeemenaLM.Core.Trainer — Type
Minimal training container shared by backend-specific training methods.
KeemenaLM.Core.causal_lm_cross_entropy — Method
Compute causal language-model cross entropy loss.
KeemenaLM.Core.causal_mask — Method
Construct a lower-triangular causal attention mask.
KeemenaLM.Core.download_model — Method
Ensure an official model artifact is installed and return its bundle directory.
KeemenaLM.Core.download_model_artifact — Method
Ensure an official model artifact is installed and return its artifact root.
KeemenaLM.Core.generate — Method
Generate text from a prompt using a backend model.
KeemenaLM.Core.load_bundle — Method
Load a model bundle from a directory.
KeemenaLM.Core.load_weights_jld2 — Method
Load backend-agnostic weight dictionaries from JLD2 format.
KeemenaLM.Core.resolve_bundle — Method
Resolve a bundle source to a local bundle directory path.
Sources can be:
- a bundle directory containing
bundle.json - a release-artifact root containing
bundle/bundle.json - an official model key from
available_models()
KeemenaLM.Core.resolve_model_artifact — Method
Resolve a full model artifact root.
For the v9 chatbot artifact this root contains bundle/, tokenizer_bundle/, and metadata. Bundle-only local directories are accepted for compatibility.
KeemenaLM.Core.resolve_tokenizer_bundle — Method
Resolve the tokenizer bundle directory for a local artifact root or official key.
KeemenaLM.Core.save_bundle — Method
Save a model bundle to a directory.
KeemenaLM.Core.save_weights_jld2 — Method
Persist backend-agnostic weight dictionaries in JLD2 format.
KeemenaLM.Core.validate — Method
Validate a GPT-2 configuration and return it when valid.
KeemenaLM.FluxBackend.FluxGPT2Model — Type
Flux GPT-2 style decoder-only LM for the Stage 4 training/inference path.
KeemenaLM.LuxBackend.LuxGPT2Model — Type
Lux GPT-2 style decoder-only LM for the Stage 7 inference path.