alt.freeweights.mistral / MegaBeam-Mistral-7B-512k
From: asp-prototyping <huggingface.co/asp-prototyping>Newsgroups: alt.freeweights.mistralSubject:

MegaBeam-Mistral-7B-512k

Date: 2026-11-15Commit: 7a9bfb1Signed: 2DC28CC7B26A283B ✓

Text generation model with 7.2B parameters. Safetensors weights, 14.5 GB in all. Published by asp-prototyping under Apache-2.0.

7.2B params14.5GBMegaBeam-Mistral-7B-512ksafetensorspermissive
FactsParams7.2BSize14.5 GBFormatssafetensorsTasktext generationLicenseApache-2.0From sourcepermissive
$ fw get asp-prototyping/MegaBeam-Mistral-7B-512k
# manifest sha256 0c09daf37aee… · 14.5 GB · 14 files
$ fw verify ./MegaBeam-Mistral-7B-512k asp-prototyping/MegaBeam-Mistral-7B-512k
From sourceHosted (signed)asp-prototyping/MegaBeam-Mistral-7B-512kLast check: 2026-11-15 02:45 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Works with

Overview

Size
14.5 GB
Weights
14.5 GB (safetensors)
Parameters
7.2B
Formats
safetensors
Task
text generation
License
Apache-2.0 (permissive)
Files
14, each with a sha256
Publisher
asp-prototyping
Added
2026-11-15
Section
alt.freeweights.mistral
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 02:45 UTCpassed

Model card

From the publisher at commit 7a9bfb1. Shown as plain text with links; images open at the publisher.

MegaBeam-Mistral-7B-512k Model#

This model, presented in Scaling Context, Not Parameters: Training a Compact 7B Language Model for Efficient Long-Context Processing, is a Long-Context LLM that supports 524,288 tokens in its context. MegaBeam-Mistral-7B-512k was trained on Mistral-7B Instruct-v0.2, and can be deployed using various serving frameworks like vLLM and Amazon SageMaker's DJL endpoint. Please refer to our GitRepo for deployment and inference examples.

New update! - Watch our talk on MegaBeam at NeurIPS 2024

Evaluations#

We evaluated MegaBeam-Mistral-7B-512k on three long-context benchmarks. For each benchmark, we deployed the MegaBeam-Mistral-7B-512k model with vLLM (v0.5.1) on an EC2 instance and obtained LLM responses through the OpenAI API provided by vLLM.

1. Needle In A Haystack - Pressure Testing LLMs

The Arize-ai NIAH varies the target random number and introduces a random city for each question, requiring the LLM to extract the random number from various selected context locations.

MegaBeam-Mistral-7B-512k scored 100% on this NIAH benchmark as shown in this plot.

Image: NIAH

2. RULER: What’s the Real Context Size of Your Long-Context Language Models?

The RULER benchmark evaluates long-context language models across four task categories - Retrieval, Multi-hop Tracing, Aggregation, and Question Answering - with a total of 13 tasks. RULER goes beyond simple in-context recall by introducing more complex long-context scenarios.

MegaBeam-Mistral-7B-512k scored an average of 88.70 across different context lengths as shown in this table (adapted from the RULER project).

Models4K8K16K32K64K128KAvg.
MegaBeam-Mistral-7B-512k93.391.891.588.983.782.888.7
Gemini-1.5-pro,-Text%20and%20images)96.795.89695.995.994.495.8
GPT-4-1106-preview96.696.395.293.28781.291.6

Llama3.1 (70B)|96.5|95.8|95.4|94.8|88.4|66.6|89.6|

| Qwen2 (72B) | 96.9 | 96.1 | 94.9 | 94.1 | 79.8 | 53.7 | 85.9 |

| Command-R-plus (104B) | 95.6 | 95.2 | 94.2 | 92 | 84.3 | 63.1 | 87.4 |

| GLM4 (9B) | 94.7 | 92.8 | 92.1 | 89.9 | 86.7 | 83.1 | 89.9 |

Llama3.1 (8B)|95.5|93.8|91.6|87.4|84.7|77.0|88.3|

| Command-R (35B) | 93.8 | 93.3 | 92.4 | 89.5 | 84.9 | 76 | 88.3 |

| GradientAI/Llama3 (70B) | 95.1 | 94.4 | 90.8 | 85.4 | 82.9 | 72.1 | 86.5 |

| Mixtral-8x22B (39B/141B) | 95.6 | 94.9 | 93.4 | 90.9 | 84.7 | 31.7 | 81.9 |

| Yi (34B) | 93.3 | 92.2 | 91.3 | 87.5 | 83.2 | 77.3 | 87.5 |

| Phi3-medium (14B) | 93.3 | 93.2 | 91.1 | 86.8 | 78.6 | 46.1 | 81.5 |

| Mixtral-8x7B (12.9B/46.7B) | 94.9 | 92.1 | 92.5 | 85.9 | 72.4 | 44.5 | 80.4 |

| GradientAI/Llama3 (8B) | 92.8 | 90.3 | 85.7 | 79.9 | 76.3 | 69.5 | 82.4 |

| FILM-7B (7B) | 92.8 | 88.2 | 88.1 | 86.9 | 70.1 | 27.1 | 75.5 |

| Mistral-7B-instruct-v0.2 (7B) | 93.6 | 91.2 | 87.2 | 75.4 | 49 | 13.8 | 68.4 |

Mistral-Nemo|87.8|87.2|87.7|69.0|46.8|19.0|66.2|

| GLM3 (6B) | 87.8 | 83.4 | 78.6 | 69.9 | 56 | 42 | 69.6 |

| LWM (7B) | 82.3 | 78.4 | 73.7 | 69.1 | 68.1 | 65 | 72.8 |

This table shows how MegaBeam-Mistral-7B-512k performed on 13 RULER tasks with increasing context lengths.

TaskCategory40968192163843276865536131072
niah_single_1Retrieval100100100100100100
niah_single_2Retrieval98.697.898.898.299.499.6
niah_single_3Retrieval10010010099.810099.8
niah_multikey_1Retrieval98.899.699.29999.699.6
niah_multikey_2Retrieval10010010099.899.498.6
niah_multikey_3Retrieval99.899.499.810098.697.8
niah_multivalueRetrieval97.193.891.8583.580.371.45
niah_multiqueryRetrieval99.9599.999.8599.399.5599.3
vtMulti-hop Tracing99.297.8896.4496.1291.689.08
cweAggregation98.290.6275.652.725.90.94
fweAggregation81.4780.0795.8796.3383.7396.87
qa_1Q & A85.68280.68380.677.4
qa_2Q & A53.85251.648.449.245.8
averageALL93.391.891.588.983.782.8
Total Average88.7

3. InfiniteBench: Extending Long Context Evaluation Beyond 100K Tokens

InfiniteBench developed 12 tasks to evaluate an LLM's capability to process, comprehend, and reason with extended contexts, specifically those with over 100,000 tokens.

We combine the InfiniteBench project's evaluation results for SOTA LLMs with MegaBeam-Mistral-7B-512k's result in this table.

| Task Name | MegaBeam-Mistral -7B-512k | GPT-4-1106 -preview | YaRN-Mistral -7B | Kimi-Chat | Claude 2 | Yi-34B -200K |

|----------------|--------------------------|--------------------|-----------------|-----------|-----------|-------------|

| PassKey | 100% | 100% | 92.71% | 98.14% | 97.80% | 100.00% |

| Retrv.Num | 99.49% | 100% | 56.61% | 95.42% | 98.14% | 100.00% |

| Retrv.KV | 24.20% | 89.00% | < 5% | 53.60% | 65.40% | < 5% |

| En.Sum | 34.66% | 14.73% | 9.09% | 17.93% | 14.45% | < 5% |

| En.QA | 20.32% | 22.22% | 9.55% | 16.52% | 11.97% | 12.17% |

| En.MC | 61.57% | 67.25% | 27.95% | 72.49% | 62.88% | 38.43% |

| En.Dia | 10.50% | 8.50% | 7.50% | 11.50% | 46.50% | < 5% |

| Zh.QA | 19.54% | 25.96% | 14.43% | 17.93% | 9.64% | 13.61% |

| Code.Debug | 26.14% | 39.59% | < 5% | 18.02% | < 5% | < 5% |

| Code.Run | 2% | 23.25% | < 5% | < 5% | < 5% | < 5% |

| Math.Calc | 0% | < 5% | < 5% | < 5% | < 5% | < 5% |

| Math.Find | 20% | 60.00% | 17.14% | 12.57% | 32.29% | 25.71% |

| Average | 34.87% | 46.08% | 20.41% | 34.93% | 37.21% | 25.41% |

Example use case#

This example demonstrates MegaBeam-Mistral-7B-512k's long context capability by processing a large file that includes hundreds of files from a single Git repository. This can be useful for onboarding new developers.

Image: demo

Serve MegaBeam-Mistral-7B-512k on EC2 instances#

On an AWS g5.48xlarge instance, install vLLM as per vLLM docs.

pip install vllm==0.6.2
Start the server#
export VLLM_ENGINE_ITERATION_TIMEOUT_S=3600
export VLLM_ALLOW_LONG_MAX_MODEL_LEN=1
python3 -m vllm.entrypoints.openai.api_server \
    --model aws-prototyping/MegaBeam-Mistral-7B-512k \
    --max-model-len 288800 \
    --tensor-parallel-size 8 \
    --enable-prefix-caching

On an instance with larger GPU RAM (e.g. p4d.24xlarge), simply remove the MAX_MODEL_LEN argument in order to support the full sequence length of 524,288 tokens:

VLLM_ENGINE_ITERATION_TIMEOUT_S=3600 python3 -m vllm.entrypoints.openai.api_server \
        --model aws-prototyping/MegaBeam-Mistral-7B-512k \
        --tensor-parallel-size 8 \
        --enable-prefix-caching
Run the client#
from openai import OpenAI

# Modify OpenAI's API key and API base to use vLLM's API server.
openai_api_key = "EMPTY"
openai_api_base = "http://localhost:8000/v1"

client = OpenAI(
    # defaults to os.environ.get("OPENAI_API_KEY")
    api_key=openai_api_key,
    base_url=openai_api_base,
)

models = client.models.list()
model = models.data[0].id

chat_completion = client.chat.completions.create(
        messages = [
            {"role": "user", "content": "What is your favourite condiment?"}, # insert your long context here
            {"role": "assistant", "content": "Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!"},
            {"role": "user", "content": "Do you have mayonnaise recipes?"} # insert your long context here
        ],
        model=model,
)

print("Chat completion results:")
print(chat_completion)
Deploy the model on a SageMaker Endpoint#

To deploy MegaBeam-Mistral-7B-512k on a SageMaker endpoint, please follow this SageMaker DJL deployment guide.\

Run the following Python code in a SageMaker notebook (with each block running in a separate cell)

import sagemaker
from sagemaker import Model, image_uris, serializers, deserializers

sagemaker_session = sagemaker.Session()
region = sagemaker_session.boto_region_name
role = sagemaker.get_execution_role()

%%writefile serving.properties
engine=Python
option.model_id=aws-prototyping/MegaBeam-Mistral-7B-512k
option.revision=g5-48x
option.dtype=bf16
option.task=text-generation
option.rolling_batch=vllm
option.tensor_parallel_degree=8
option.device_map=auto

%%sh
mkdir mymodel
mv serving.properties mymodel/
tar czvf mymodel.tar.gz mymodel/
rm -rf mymodel

image_uri = image_uris.retrieve(
        framework="djl-deepspeed",
        region=region,
        version="0.27.0"
)

s3_code_prefix = "megaBeam-mistral-7b-512k/code"
bucket = sagemaker_session.default_bucket()  # bucket to house artifacts
code_artifact = sagemaker_session.upload_data("mymodel.tar.gz", bucket, s3_code_prefix)
print(f"S3 Code or Model tar ball uploaded to --- &gt; {code_artifact}")
model = Model(image_uri=image_uri, model_data=code_artifact, role=role)

instance_type = "ml.g5.48xlarge"
endpoint_name = sagemaker.utils.name_from_base("megaBeam-mistral-7b-512k")
model.deploy(initial_instance_count=1,
             instance_type=instance_type,
             endpoint_name=endpoint_name
            )

# our requests and responses will be in json format so we specify the serializer and the deserializer
predictor = sagemaker.Predictor(
    endpoint_name=endpoint_name,
    sagemaker_session=sagemaker_session,
    serializer=serializers.JSONSerializer(),
)

# test the endpoint
input_str = """<s>[INST] What is your favourite condiment? [/INST]
Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!</s> "
[INST] Do you have mayonnaise recipes? [/INST]"""
predictor.predict(
    {"inputs": input_str, "parameters": {"max_new_tokens": 75}}
)
Invoke the model on a SageMaker Endpoint#

To use MegaBeam-Mistral-7B-512k on a SageMaker endpoint, please try following this example:

import boto3
import json

def call_endpoint(text:str, endpoint_name:str):
    client = boto3.client("sagemaker-runtime")

    parameters = {
        "max_new_tokens": 450,
        "do_sample": True,
        "temperature": 0.7,
    }

    payload = {"inputs": text, "parameters": parameters}

    response = client.invoke_endpoint(
        EndpointName=endpoint_name, Body=json.dumps(payload), ContentType="application/json"
    )

    output = json.loads(response["Body"].read().decode())

    result = output["generated_text"]
    return result

# please insert your long prompt/document content here
prompt = """<s>[INST] What are the main challenges to support long contexts for a Large Language Model? [/INST]"""

#print(prompt)
endpoint_name = "megaBeam-mistral-7b-512k-2024-05-13-14-23-41-219" # please use a valid endpoint name
result = call_endpoint(prompt, endpoint_name)
print(result)

Limitations#

Before using the MegaBeam-Mistral-7B-512k model, it is important to perform your own independent assessment, and take measures to ensure that your use would comply with your own specific quality control practices and standards, and that your use would comply with the local rules, laws, regulations, licenses and terms that apply to you, and your content.

Citation#

If you find our work helpful, feel free to give us a cite.

@article{wu2025scaling,
  title={Scaling Context, Not Parameters: Training a Compact 7B Language Model for Efficient Long-Context Processing},
  author={Wu, Chen and Song, Yin},
  journal={arXiv preprint arXiv:2505.08651},
  year={2025}
}

Files

14 files · 14.5 GBWeights 14.5 GB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 14 files with their sha256
FileSizesha256
.gitattributes1.52 KB11ad7efa24975ee4b0c3c3a38ed18737f0658a5f75a0a96787b576a78a023361
README.md16.3 KBe45afc597d259e8f0ec54815ba73416c3091d314862ae9ba6739e691f043c4de
config.json680 Bd32947d6dcbccf19cfb593a817cf13fed4ac4da0881e62049de46fd5ffa94bb9
generation_config.json111 Be4c7d15deb9cdc781875c915f12b70feefeb4c087a358e582a9c96b9b1cad74a
megabeam_git_demo.gif4.13 MB758503d53ef450e9b190f51a48ce96d90b62a2ffea050e3d3233790b8fcc3433
model-00001-of-00003.safetensors4.94 GB1c90d5809d981ca58eda58fd4475c95550f9577dd60c42efbe0b37af6be026ad
model-00002-of-00003.safetensors5.00 GB66b2a53743083d4fbf36f495d071a56bb52b0f87a2cb1017f441c7ac800fb20c
model-00003-of-00003.safetensors4.54 GB8daedce90f44c8d42ece12c1bc7ae5765d5c9b2f3a94eba31ffb08e559969b97
model.safetensors.index.json23.9 KBa84fdfb94dda41f43767e02136d30bd102ef33c2d996218628cbd906b33e7dfb
niah_megabeam-mistral-7b-512k.png94.1 KB381cd8abb7fa2e2afc077bc4cd9fd4d3cec5a30c953c2a9dd59ff2e5f1c594be
special_tokens_map.json72 B96bdbb8504d9967606e5f661ccc7cbbac44a3661af863a7a58614670a0ccab33
tokenizer.json1.80 MBfc4f0bd70b3709312d9d1d9e5ba674794b6bc5abc17429897a540f93882f25fc
tokenizer.model493 KBdadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055
tokenizer_config.json2.07 KBe6d2c3821a9495183bf84636f86fdd9e4ed36a72aa2341862532bf346958aad9
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
7a9bfb11b5 pinned now2026-11-15 02:45 UTC14 files · 14.5 GB

Use it

$ fw get asp-prototyping/MegaBeam-Mistral-7B-512k
# manifest sha256 0c09daf37aee… · 14.5 GB · 14 files
$ fw verify ./MegaBeam-Mistral-7B-512k asp-prototyping/MegaBeam-Mistral-7B-512k
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/asp-prototyping/MegaBeam-Mistral-7B-512k.json --dir ./MegaBeam-Mistral-7B-512k $ python3 fw.py verify ./MegaBeam-Mistral-7B-512k ./asp-prototyping__MegaBeam-Mistral-7B-512k.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download asp-prototyping/MegaBeam-Mistral-7B-512k --revision 7a9bfb11b5d5e56eae0e4b52290d705cdd55f7a6 --local-dir ./MegaBeam-Mistral-7B-512k
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModelForCausalLM, AutoTokenizer tok = AutoTokenizer.from_pretrained("asp-prototyping/MegaBeam-Mistral-7B-512k", revision="7a9bfb11b5d5e56eae0e4b52290d705cdd55f7a6") model = AutoModelForCausalLM.from_pretrained("asp-prototyping/MegaBeam-Mistral-7B-512k", revision="7a9bfb11b5d5e56eae0e4b52290d705cdd55f7a6", device_map="auto")
vLLMServe an OpenAI-compatible API.
$ HF_ENDPOINT=https://freeweights.allternit.com vllm serve asp-prototyping/MegaBeam-Mistral-7B-512k --revision 7a9bfb11b5d5e56eae0e4b52290d705cdd55f7a6

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
e45afc597d259e8f0ec54815ba73416c3091d314862ae9ba6739e691f043c4de
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: asp-prototyping <huggingface.co/asp-prototyping>Newsgroups: alt.freeweights.mistralSubject: MegaBeam-Mistral-7B-512kDate: 2026-11-15Commit: 7a9bfb1Signed: 2DC28CC7B26A283B ✓
Upstream
asp-prototyping/MegaBeam-Mistral-7B-512k
Pinned commit
7a9bfb11b5d5e56eae0e4b52290d705cdd55f7a6
Manifest
MegaBeam-Mistral-7B-512k.json · .minisig
Manifest sha256
0c09daf37aeeefde31d2a26cd6c565fbe283390dfe2dd4b11715c96d971a9445
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 02:45 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/asp-prototyping/MegaBeam-Mistral-7B-512k.json $ curl -O https://freeweights.allternit.com/manifests/asp-prototyping/MegaBeam-Mistral-7B-512k.json.minisig $ minisign -Vm MegaBeam-Mistral-7B-512k.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

1 model in the catalog name this one as their parent.

Quantizations
1
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download asp-prototyping/MegaBeam-Mistral-7B-512k
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. MegaBeam-Mistral-7B-512k.json. Provenance. Takedown history: none.

Variants

1 quantized or adapter build of MegaBeam-Mistral-7B-512k. Each has its own license check and page.

From: bartowski <huggingface.co/bartowski>Subject: alamios_Mistral-Small-3.1-DRAFT-0.5B-GGUF
From: microsoft <huggingface.co/microsoft>Subject: chatbench-mistral-7b
From: NousResearch <huggingface.co/NousResearch>Subject: DeepHermes-3-Mistral-24B-Preview
From: mistralai <huggingface.co/mistralai>Subject: Devstral-Small-2-24B-Instruct-2512
From: mlx-community <huggingface.co/mlx-community>Subject: Devstral-Small-2-24B-Instruct-2512-4bit
From: mlx-community <huggingface.co/mlx-community>Subject: Devstral-Small-2-24B-Instruct-2512-6bit