Text Generation
Transformers
Safetensors
PyTorch
English
neollm
causal-lm
research
bf16
attention
normalization
conversational
custom_code
Instructions to use KitsuVp/NeoLLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KitsuVp/NeoLLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="KitsuVp/NeoLLM", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("KitsuVp/NeoLLM", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use KitsuVp/NeoLLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KitsuVp/NeoLLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KitsuVp/NeoLLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/KitsuVp/NeoLLM
- SGLang
How to use KitsuVp/NeoLLM with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "KitsuVp/NeoLLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KitsuVp/NeoLLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "KitsuVp/NeoLLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KitsuVp/NeoLLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use KitsuVp/NeoLLM with Docker Model Runner:
docker model run hf.co/KitsuVp/NeoLLM
Update configuration_neollm.py
Browse files- configuration_neollm.py +21 -8
configuration_neollm.py
CHANGED
|
@@ -156,10 +156,12 @@ class NeoLLMConfig(PretrainedConfig):
|
|
| 156 |
General dropout probability for attention outputs and MLP states.
|
| 157 |
use_embedding_input_norm (:obj:`bool`, *optional*, defaults to ``True``):
|
| 158 |
Controls only the first pre-attention normalisation applied to the
|
| 159 |
-
raw embedding stream. When ``True``, layer 0
|
| 160 |
-
before its attention block, preserving the previous
|
| 161 |
-
``False``, layer 0
|
| 162 |
-
|
|
|
|
|
|
|
| 163 |
use_token_generator (:obj:`bool`, *optional*, defaults to ``False``):
|
| 164 |
Replace the discrete vocabulary embedding lookup table with a
|
| 165 |
**Leviathan** continuous token generator (Batley & Saha, 2026).
|
|
@@ -206,6 +208,14 @@ class NeoLLMConfig(PretrainedConfig):
|
|
| 206 |
values, such as ``32``, are valid memory-saving variants but are
|
| 207 |
not the full paper-faithful default. Ignored when
|
| 208 |
``use_token_generator=False``.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
use_jtokm (:obj:`bool`, *optional*, defaults to ``False``):
|
| 210 |
Enable the **Leviathan-JTok-M** token-indexed modulation module
|
| 211 |
(Yang et al., 2026; fused with Leviathan geometry).
|
|
@@ -607,13 +617,14 @@ class NeoLLMConfig(PretrainedConfig):
|
|
| 607 |
# ── Embedding input normalization ─────────────────────────────────
|
| 608 |
use_embedding_input_norm=False,
|
| 609 |
# ── Leviathan continuous token generator ──────────────────────────
|
| 610 |
-
use_token_generator=
|
| 611 |
generator_d_seed=128,
|
| 612 |
generator_num_modes=8,
|
| 613 |
generator_num_knots=32,
|
| 614 |
generator_spline_degree=2,
|
| 615 |
generator_k=3,
|
| 616 |
-
generator_krank=
|
|
|
|
| 617 |
# ── Leviathan-JTok-M token-indexed modulation ─────────────────────
|
| 618 |
use_jtokm=False,
|
| 619 |
jtokm_num_experts=4,
|
|
@@ -856,8 +867,9 @@ class NeoLLMConfig(PretrainedConfig):
|
|
| 856 |
# ── Embedding input normalization ─────────────────────────────────
|
| 857 |
# True preserves the previous layer-0 pre-norm path:
|
| 858 |
# embeddings -> SeeDNorm -> LNS -> attention.
|
| 859 |
-
# False
|
| 860 |
-
# first attention block
|
|
|
|
| 861 |
self.use_embedding_input_norm = use_embedding_input_norm
|
| 862 |
|
| 863 |
# ── Leviathan generator ───────────────────────────────────────────
|
|
@@ -868,6 +880,7 @@ class NeoLLMConfig(PretrainedConfig):
|
|
| 868 |
self.generator_spline_degree = generator_spline_degree
|
| 869 |
self.generator_k = generator_k
|
| 870 |
self.generator_krank = generator_krank
|
|
|
|
| 871 |
|
| 872 |
# ── Leviathan-JTok-M ─────────────────────────────────────────────
|
| 873 |
self.use_jtokm = use_jtokm
|
|
|
|
| 156 |
General dropout probability for attention outputs and MLP states.
|
| 157 |
use_embedding_input_norm (:obj:`bool`, *optional*, defaults to ``True``):
|
| 158 |
Controls only the first pre-attention normalisation applied to the
|
| 159 |
+
raw embedding stream. When ``True``, layer 0 instantiates and applies
|
| 160 |
+
``SeeDNorm`` before its attention block, preserving the previous
|
| 161 |
+
behaviour. When ``False``, layer 0 does not instantiate that
|
| 162 |
+
``SeeDNorm`` module, so its parameters are actually removed and raw
|
| 163 |
+
token embeddings enter the first attention block directly. All deeper
|
| 164 |
+
decoder layers keep their normal pre-norm flow unchanged.
|
| 165 |
use_token_generator (:obj:`bool`, *optional*, defaults to ``False``):
|
| 166 |
Replace the discrete vocabulary embedding lookup table with a
|
| 167 |
**Leviathan** continuous token generator (Batley & Saha, 2026).
|
|
|
|
| 208 |
values, such as ``32``, are valid memory-saving variants but are
|
| 209 |
not the full paper-faithful default. Ignored when
|
| 210 |
``use_token_generator=False``.
|
| 211 |
+
generator_khronos_chunk_size (:obj:`int`, *optional*, defaults to 16):
|
| 212 |
+
Number of seed dimensions evaluated at once inside the Leviathan
|
| 213 |
+
KHRONOS tensor product. This does not change the mathematical
|
| 214 |
+
function: it computes the same product by accumulating
|
| 215 |
+
``Σ_d log|phi_d|`` over chunks. The default ``16`` avoids
|
| 216 |
+
materializing the full ``[N, d_seed, krank]`` tensor during
|
| 217 |
+
torch.compile/AOTAutograd while preserving the article's separable
|
| 218 |
+
product.
|
| 219 |
use_jtokm (:obj:`bool`, *optional*, defaults to ``False``):
|
| 220 |
Enable the **Leviathan-JTok-M** token-indexed modulation module
|
| 221 |
(Yang et al., 2026; fused with Leviathan geometry).
|
|
|
|
| 617 |
# ── Embedding input normalization ─────────────────────────────────
|
| 618 |
use_embedding_input_norm=False,
|
| 619 |
# ── Leviathan continuous token generator ──────────────────────────
|
| 620 |
+
use_token_generator=False,
|
| 621 |
generator_d_seed=128,
|
| 622 |
generator_num_modes=8,
|
| 623 |
generator_num_knots=32,
|
| 624 |
generator_spline_degree=2,
|
| 625 |
generator_k=3,
|
| 626 |
+
generator_krank=64,
|
| 627 |
+
generator_khronos_chunk_size=16,
|
| 628 |
# ── Leviathan-JTok-M token-indexed modulation ─────────────────────
|
| 629 |
use_jtokm=False,
|
| 630 |
jtokm_num_experts=4,
|
|
|
|
| 867 |
# ── Embedding input normalization ─────────────────────────────────
|
| 868 |
# True preserves the previous layer-0 pre-norm path:
|
| 869 |
# embeddings -> SeeDNorm -> LNS -> attention.
|
| 870 |
+
# False removes that first SeeDNorm module entirely, so raw embeddings
|
| 871 |
+
# enter the first attention block and the layer-0 input-norm parameters
|
| 872 |
+
# are not counted; layers >= 1 keep their pre-norm unchanged.
|
| 873 |
self.use_embedding_input_norm = use_embedding_input_norm
|
| 874 |
|
| 875 |
# ── Leviathan generator ───────────────────────────────────────────
|
|
|
|
| 880 |
self.generator_spline_degree = generator_spline_degree
|
| 881 |
self.generator_k = generator_k
|
| 882 |
self.generator_krank = generator_krank
|
| 883 |
+
self.generator_khronos_chunk_size = generator_khronos_chunk_size
|
| 884 |
|
| 885 |
# ── Leviathan-JTok-M ─────────────────────────────────────────────
|
| 886 |
self.use_jtokm = use_jtokm
|