Skip to content
Computer vision

Qwen3.8-40B-Ultimate-Heretic-Uncensored-Build2-v17

model with episodic memory

2 min readupdated

This is a new version of the flagship 40-billion parameter language model (based on DavidAU's work), enhanced with the V17 episodic memory architecture. The model saves observations, keys, and values to persistent storage, allowing it to reference past dialogues even after a server restart. The system automatically consolidates data during idle time (sleep function) and forecasts events using timestamps. It is well-suited for developers of smart assistants and local knowledge bases who need long-term context memory without losing accuracy.

Key features

  • Episodic memory: preservation of key attention points and states in external storage.
  • Background processing (Sleep): transfer of new observations and verification of data links during service idle time.
  • Forecasting: evaluation of future state probabilities using timestamps and past event chains.
  • SGLang integration: deployment in Docker with support for a format 8 persistent memory volume.

What you can do

  • Deploy a local chat server via SGLang with preserved dialog history between sessions.
  • Use the Transformers library to integrate the model with built-in memory into Python scripts.
  • Set up automatic knowledge base updates and background fact-checking.

Example

import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer

repo = "LTM-Lab/Qwen3.8-40B-Ultimate-Heretic-Uncensored-Build2-v17"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForImageTextToText.from_pretrained(
    repo, trust_remote_code=True, dtype="auto", device_map={"": 0}
).eval()
model.reopen_memory(storage_path="./qwen-40b-v17-store")

note = "The spare key is in locker QV-823."
with torch.inference_mode(), model.memory_source(role="user", text=note):
    model(**tokenizer(note, return_tensors="pt").to(model.device))
Read moreDetails
• Base model: LTM-Lab/Qwen3.8-40B-Ultimate-Heretic-Uncensored-Build2-v16
• Parameters: 39.96 billion, 96 layers (24 full attention layers involved in memory)
• Requirements: GPU with BF16 support (weights take about 79.9 GB)
• Limitations: Memory token budget is limited; long-term operation requires backing up the SQLite database and segments.
Discuss Telegram 0

Will it run?

Runs in 4-bit

Full precision does not fit, a quantised version does: quality barely changes down to 8 bits, more noticeably at 4 bits.

  • BF16weights 74 GB · ready files82 GB
  • FP8 / INT8recommendedweights 37 GB41 GB
  • 4-bitweights 21 GB24 GB

Tip: go 8-bit.FP8 / INT8 is within about a percent of full precision in quality, takes half the memory and runs faster on RTX 40/50 and H100. Full precision only pays off for fine-tuning.

Estimate: weights plus working memory. Long videos, high resolutions and long contexts need more.

Run it on Massed Compute

The script downloads the model to the rented machine. How to run it is in the model card.

  1. 1. Rent a machine with a fitting GPU

    Open Massed Compute
  2. 2. Paste the script into the machine's terminal

    Connect over SSH (the Massed Compute panel shows the command) or open a terminal on the machine's desktop.

    HF_TOKEN / CIVITAI_TOKENThe script starts with token lines: paste yours between the quotes. The Hugging Face token is for gated models, the Civitai one for Civitai models.

    # LTM-Lab/Qwen3.8-40B-Ultimate-Heretic-Uncensored-Build2-v17
    mkdir -p ~/models
    curl -LsSf https://astral.sh/uv/install.sh | sh
    source "$HOME/.local/bin/env"
    uv tool install "huggingface_hub[cli]"
    hf download LTM-Lab/Qwen3.8-40B-Ultimate-Heretic-Uncensored-Build2-v17 --local-dir ~/models/Qwen3.8-40B-Ultimate-Heretic-Uncensored-Build2-v17
    # The model is in ~/models. How to run it is in the model card (link above).
  3. 3. Use it

    The model is in ~/models. How to run it is in the model card (link above).

Stop the machine in the panel when you are done: it bills by the minute while it runs.

How to speed it up

Picked for this model type. Choose your hardware above to see what fits you exactly.

  • FlashAttention 44.0.0b40from November 18, 2026new release

    fastest exact attention on B200

    Kernels for Blackwell (beta). Exact attention without quantisation — fine for everything, LLMs included.

    How to enable: pip install flash-attn-4; vLLM and SGLang pick it up themselves.

    Earlier generations (2)
    • FlashAttention 3 — The Hopper (H100/H200) version with FP8.
    • FlashAttention 2 — The standard for RTX 30/40/50 and A100: exact attention without the memory cost of long contexts.
  • torch.compile2.15.0from October 28, 2026new release

    10–30% for free

    Compiles the model for your GPU. Slower first run, faster afterwards.

    How to enable: model = torch.compile(model); in ComfyUI the TorchCompileModel node.

Model family

  1. Qwen3.8-27Bfamily root
  2. Qwen3.8-40B-Ultimate-Heretic-Uncensored-Build2
  3. Qwen3.8-40B-Ultimate-Heretic-Uncensored-Build2-v15
  4. Qwen3.8-40B-Ultimate-Heretic-Uncensored-Build2-v16
  5. Qwen3.8-40B-Ultimate-Heretic-Uncensored-Build2-v17

New posts about versions of Qwen3.8-27B (quants, finetunes, LoRAs) will show up under the bell.

Quantised versions 12All on Hugging Face
Fine-tunes 12All on Hugging Face
LoRAs and adapters 2All on Hugging Face

About the model

LTM-Lab/Qwen3.8-40B-Ultimate-Heretic-Uncensored-Build2-v17
Author
LTM-Lab
Category
Computer vision
Released
Posted

On NeyroLearn

Hugging Face

00

Ask AI about this model

Answered by Gemini 4 · the chat is kept only in this tab

Comments