Skip to main content

���� SCLM: Stateful Coherent Language Model

PyPI version SCLM License Hugging Face Python 3.8+

SCLM is architecture who adds persistent latent memory to transformer models, enabling better coherence across long conversations and multi-turn generation.

���� Documentation | �������� Version Fran��aise | ���� Paper | ���� Commercial Licensing


������ Licensing

SCLM is Proprietary Software under a dual-licensing model.

���� Free for:

  • ��� Personal & hobbyist projects
  • ��� Academic research (non-profit)
  • ��� Small businesses (revenue < $100,000 USD/year)

���� Commercial License Required for:

  • ��� Organizations with revenue > $100,000 USD/year
  • ��� SaaS products (any revenue)
  • ��� Redistribution in proprietary products

���� Contact: amewebstudio35@gmail.com


��� Features

  • ���� Persistent Memory: State that evolves across conversation turns
  • ���� Entity Coherence: Maintains context about characters, places, objects
  • ������ Edit Mode: Make local changes without affecting global memory
  • ��� Lightweight: Only ~2-5% additional parameters (PACER architecture)
  • ���� Easy Integration: Works with any HuggingFace transformer

���� Installation

# Basic installation
pip install saclm

# With quantization support
pip install saclm[quantization]

# Full installation (all features)
pip install saclm[full]

���� Quick Start

from sclm import SCLMModel

# Load SCLM model from Hugging Face
model = SCLMModel.from_pretrained(
    "amewebstudio/ananke-sclm",     # Pre-trained SCLM model
    load_in_4bit=True  # Optional: 4-bit quantization
)

ananke-sclm is a demo checkpoint, not a requirement. from_pretrained() accepts any HuggingFace causal LM ��� swap in your own model name and it will load with a freshly-initialized PACER module. That module starts untrained, so you'll need to fine-tune it before the coherence benefit shows up (see Limitations). ananke-sclm ships pre-trained specifically so this Quick Start works out of the box.

# Start new conversation
model.reset_state()

# Build context
model.add_context("The wizard Elara lives in Silverwood forest.")
model.add_context("Her familiar is a silver cat named Nimbus.")

# Generate with memory - entities are remembered!
output = model.generate("One day, Elara decided to", max_new_tokens=50)
print(output)
# "One day, Elara decided to take Nimbus on a journey through Silverwood..."

���� Architecture: PACER

SCLM uses the PACER architecture:

SCLM Architecture

PACER = Propagation + Alignment + Coherence + Encapsulation + Revision
Component Function
Encapsulation GRU-style state update from hidden states
Alignment Cross-attention between state and hidden layers
Revision Drift detection and correction
Coherence Mixture-of-Experts for consistency
Propagation State injection into transformer layers
���������������������������������������������������������
���  Hidden States  ���
���������������������������������������������������������
         ���
    ���������������������������������
    ���         ���
��������������������������� ���������������������������
���Encaps.��� ���Inject ���
��������������������������� ���������������������������
    ���
    ���
���������������������������������������
���  Latent   ���
���   State   ��������������������������� Persists across turns
���������������������������������������

���� Use Cases

Interactive Fiction

model.reset_state()

# Build story world
model.add_context("The kingdom of Eldoria was ruled by Queen Lyra.")
model.add_context("The royal advisor Marcus had served for decades.")

# Characters persist in memory
output = model.generate("Marcus approached the throne and said")
# Marcus and Queen Lyra are remembered correctly

Long Conversations

# Memory persists without growing context window
for turn in conversation_turns:
    model.add_context(turn)

# Generate response with all context in memory
response = model.generate("Based on our discussion,")

Creative Writing

# Chapter 1
model.add_context("Chapter 1: Sarah discovered an old map in the attic.")

# Chapter 2 - Sarah is remembered
output = model.generate("Chapter 2: The next morning, Sarah")

������ Configuration

from sclm import SCLMConfig

# Custom configuration
config = SCLMConfig(
    latent_state_dim=256,        # State vector dimension
    n_experts=2,                  # Number of MoE experts
    state_injection_layers=[8, 16],  # Which layers to inject
    alpha_inject=0.02,            # Injection strength
)

# Use with model
model = SCLMModel.from_pretrained("model-name", config=config)

Presets

from sclm.config import get_preset

# Use optimized presets
config = get_preset("mistral-7b")  # or "llama-7b", "phi-2", "tiny"

���� API Reference

SCLMModel

Method Description
from_pretrained(name) Load model from HuggingFace
reset_state() Reset memory for new conversation
add_context(text) Add context to memory
generate(prompt) Generate text with memory
freeze_state() Freeze memory for editing
save_checkpoint(path) Save model checkpoint

Properties

Property Description
state_norm Current state vector norm
state Current state tensor

���� Benchmarks

Model PACER Params Overhead Entity Retention
Mistral-7B 91.7M 2.4% 85%
LLaMA-7B 91.7M 2.4% 83%
Phi-2 52.3M 1.9% 81%

������� Advanced Usage

Edit Mode

# Establish context
model.add_context("The sword was blue and ancient.")

# Make edit without changing memory
model.freeze_state()
output = model.generate("The sword was RED")  # State unchanged
model.unfreeze_state()

Memory Tracking

from sclm.utils import MemoryTracker

tracker = MemoryTracker(model)
tracker.add("Context 1")
tracker.add("Context 2")
output = tracker.generate("Prompt")

print(tracker.summary())
tracker.plot_state_evolution()  # Visualize state changes

�������� Documentation Fran��aise

Qu'est-ce que SCLM ?

SCLM (Stateful Coherent Language Model) ajoute une m��moire latente persistante aux mod��les de langage transformers, permettant une meilleure coh��rence dans les longues conversations.

������ Licence

SCLM est un logiciel propri��taire sous un mod��le de double licence.

���� Gratuit pour :

  • ��� Projets personnels et hobbyistes
  • ��� Recherche acad��mique (non lucratif)
  • ��� Petites entreprises (revenus < 100 000 $ USD/an)

���� Licence commerciale requise pour :

  • ��� Organisations avec revenus > 100 000 $ USD/an
  • ��� Produits SaaS (tout revenu)
  • ��� Redistribution dans des produits propri��taires

���� Contact : amewebstudio35@gmail.com

Installation

pip install saclm

D��marrage Rapide

from sclm import SCLMModel

# Charger le mod��le SCLM depuis Hugging Face
model = SCLMModel.from_pretrained(
    "amewebstudio/ananke-sclm",
    load_in_4bit=True
)

# Nouvelle conversation
model.reset_state()

# Construire le contexte
model.add_context("Le sorcier ��lara vit dans la for��t de Boisargent.")
model.add_context("Son familier est un chat argent�� nomm�� Nimbus.")

# G��n��rer avec m��moire
output = model.generate("Un jour, ��lara d��cida de", max_new_tokens=50)
print(output)

Architecture PACER

Composant Fonction
Encapsulation Mise �� jour de l'��tat style GRU
Alignement Cross-attention ��tat ��� hidden
R��vision D��tection et correction de d��rive
Coh��rence Mixture d'Experts (MoE)
Propagation Injection dans les couches

���� Citation

@article{amega2025sclm,
  title={SCLM: Stateful Coherent Language Models with PACER Architecture},
  author={Amega, Mike},
  year={2025},
  note={AMEFORGE - Proprietary}
}

���� License

Business Source License 1.1 (BSL-1.1) - See LICENSE for details.

Copyright (c) 2025 AMEFORGE. All Rights Reserved.

���� Author

Mike Amega - AMEFORGE
���� amewebstudio35@gmail.com
���� github.com/Volgat


���� Commercial Licensing

For commercial licensing inquiries, enterprise support, or custom development:

���� Email: amewebstudio35@gmail.com

Commercial Benefits:

  • ��� Legal compliance for enterprise use
  • ��� Priority technical support
  • ��� Right to redistribute
  • ��� Warranty and indemnification
  • ��� Custom feature development

Metadata

Release files for saclm 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for saclm 0.1.4
File Size Uploaded
saclm-0.1.4.tar.gz 49.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for saclm 0.1.4
File Interpreter ABI Platform
saclm-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 76.3 kB

Release files / saclm-0.1.4.tar.gz

Download URL saclm-0.1.4.tar.gz
Size 49.7 kB
Tags Source
SHA-256 checksum
How to use checksums
546f692b5fa99495cddcc244256facd6c686cd62a0c22b2fae71d5b682a9693f
BLAKE2b-256 checksum
How to use checksums
52ec9153d8bf4331b6ff8c6fd8bca2d1c325b3d8847666fac4ff13e070239cea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pypi-skill/1.0

Release files / saclm-0.1.4-py3-none-any.whl

Download URL saclm-0.1.4-py3-none-any.whl
Size 26.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a236150203fb084542d702d0e7ced1d4bb3929c9c0b8feffab51a6e170b9269a
BLAKE2b-256 checksum
How to use checksums
5362c04970184c250b8ae6c977424bf5558c5646a0314fac603a834ac3e339ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pypi-skill/1.0

Release history Release notifications | RSS feed

0.1.6

2 release files

0.1.5

2 release files

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page