alt.freeweights.text / kosmos-2.5-chat
From: microsoft <huggingface.co/microsoft>Newsgroups: alt.freeweights.textSubject:

kosmos-2.5-chat

Date: 2026-11-15Commit: edf7d31Signed: 2DC28CC7B26A283B ✓

Image text to text model with 1.4B parameters. Safetensors weights, 5.51 GB in all. Published by microsoft under MIT.

1.4B params5.51GBkosmos-2.5-chatsafetensorspermissive
FactsParams1.4BSize5.51 GBFormatssafetensorsTaskimage text to textLicenseMITFrom sourcepermissive
$ fw get microsoft/kosmos-2.5-chat
# manifest sha256 28dbd3e9a420… · 5.51 GB · 12 files
$ fw verify ./kosmos-2.5-chat microsoft/kosmos-2.5-chat
From sourceHosted (signed)microsoft/kosmos-2.5-chatLast check: 2026-11-15 03:51 UTC

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

Runs withAIBrixBentoMLCTranslate2ExLlamaV2ExLlamaV3exofastllmFlashInferKTransformersLitServeLMCacheLMDeployLocalAImistral.rsMLC LLMMooncakeSGLangText Generation WebUItinygradTransformersTriton Inference ServervLLMXinferenceFine-tune withAccelerateAlignment HandbookAxolotlColossal-AIDeepSpeedEasyR1FlashAttentionH2O LLM StudioJAXKerasLiger KernelLitGPTLLaMA-FactoryMegatron-LMms-swiftnanotronOLMo-coreOpenRLHFOumiPEFTPyTorch Lightningsd-scriptsSimpleTunerTorchTitantorchtuneTransformer EngineTRLUnslothverlConvert withAQLMAutoRoundCore ML ToolsExecuTorchGPTQModelLLM CompressormergekitNeural CompressorOliveONNXOptimum QuantoOptimumsafetensorsTensorRT Model OptimizertorchaoEvaluate withAutoevalsDeepEvalEvaluateHELMLightEvallm-evaluation-harnessOpenCompassOpikRagassimple-evalsSWE-benchTruLensWeaveScan withAgentDojoAI Fairness 360DeepTeamDetoxifyFairlearngarakGiskardGuardrailsMCP ScannerModelScanNeMo GuardrailspicklescanpromptfooWorks withAgent Development KitAG2Google AI Edge GalleryAiderany-llmAnythingLLMBAMLbrowser-useCAMELHugging Face Chat UIChatboxCherry StudioClineCodex CLICogneeCrewAIDeerFlowdocTRDSPyEasyOCREnchantedGemini CLIGitHub MCP ServergooseGPT ResearcherGradioGraphitiGuidanceHollamaInstructorKilo CodeLangflowLangGraphLiteLLMLlamaIndexLLMLocalAGILoLLMs WebUIMCP Python SDKMem0MetaGPTNextChatOllama JavaScriptOllama PythonolmOCROpenAI Agents SDKopencodeOpenHandsotermOutlinesPage AssistPlaywright MCPPortkey AI GatewayPrivateGPTQwen CodeRWKV RunnerSemantic KernelsmolagentsStrands AgentsSuryaVaneXGrammar

Overview

Size
5.51 GB
Weights
5.50 GB (safetensors)
Parameters
1.4B
Formats
safetensors
Task
image text to text
License
MIT (permissive)
Files
12, each with a sha256
Publisher
microsoft
Added
2026-11-15
Section
alt.freeweights.text
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 03:51 UTCpassed

Model card

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

Kosmos-2.5-chat#

Microsoft Document AI | GitHub

Model description#

Kosmos-2.5 is a multimodal literate model for machine reading of text-intensive images. Pre-trained on large-scale text-intensive images, Kosmos-2.5 excels in two distinct yet cooperative transcription tasks: (1) generating spatially-aware text blocks, where each block of text is assigned its spatial coordinates within the image, and (2) producing structured text output that captures styles and structures into the markdown format. This unified multimodal literate capability is achieved through a shared decoder-only auto-regressive Transformer architecture, task-specific prompts, and flexible text representations. We evaluate Kosmos-2.5 on end-to-end document-level text recognition and image-to-markdown text generation. Furthermore, the model can be readily adapted for any text-intensive image understanding task with different prompts through supervised fine-tuning, making it a general-purpose tool for real-world applications involving text-rich images. This work also paves the way for the future scaling of multimodal large language models.

Kosmos-2.5-chat is a model specifically trained for Visual Question Answering (VQA) tasks, based on further training of Kosmos-2.5. For more details about Kosmos-2.5-chat, please refer to the paper.

Kosmos-2.5: A Multimodal Literate Model

Usage#

KOSMOS-2.5 is supported from Transformers >= 4.56. Find the docs here.

import re
import torch
import requests
from PIL import Image, ImageDraw
from transformers import AutoProcessor, Kosmos2_5ForConditionalGeneration

repo = "microsoft/kosmos-2.5-chat"
device = "cuda:0"
dtype = torch.bfloat16

model = Kosmos2_5ForConditionalGeneration.from_pretrained(repo,
                                                          device_map=device,
                                                          torch_dtype=dtype,
                                                          attn_implementation="flash_attention_2")
processor = AutoProcessor.from_pretrained(repo)

# sample image
url = "https://huggingface.co/microsoft/kosmos-2.5/resolve/main/receipt_00008.png"

image = Image.open(requests.get(url, stream=True).raw)

question = "What is the sub total of the receipt?"
template = "<md>A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {} ASSISTANT:"
prompt = template.format(question)
inputs = processor(text=prompt, images=image, return_tensors="pt")

height, width = inputs.pop("height"), inputs.pop("width")
raw_width, raw_height = image.size
scale_height = raw_height / height
scale_width = raw_width / width

inputs = {k: v.to(device) if v is not None else None for k, v in inputs.items()}
inputs["flattened_patches"] = inputs["flattened_patches"].to(dtype)
generated_ids = model.generate(
    **inputs,
    max_new_tokens=1024,
)

generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)
print(generated_text[0])

NOTE:#

Since this is a generative model, there is a risk of hallucination during the generation process, and it CAN NOT guarantee the accuracy of all results in the images.

Inference#

Document Understanding Task: For usage instructions, please refer to chat.py.

Citation#

If you find Kosmos-2.5-chat useful in your research, please cite the following paper:

@article{lv2023kosmos,
  title={Kosmos-2.5: A multimodal literate model},
  author={Lv, Tengchao and Huang, Yupan and Chen, Jingye and Cui, Lei and Ma, Shuming and Chang, Yaoyao and Huang, Shaohan and Wang, Wenhui and Dong, Li and Luo, Weiyao and others},
  journal={arXiv preprint arXiv:2309.11419},
  year={2023}
}

License#

The content of this project itself is licensed under the MIT

Microsoft Open Source Code of Conduct

Files

12 files · 5.51 GBWeights 5.50 GB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 12 files with their sha256
FileSizesha256
.gitattributes1.52 KB11ad7efa24975ee4b0c3c3a38ed18737f0658a5f75a0a96787b576a78a023361
README.md4.32 KBc98ea84958beb923bc4cc02efe3d385061d63ebbe95b51d47da842563767838c
chat.py1.58 KB8253032232344768568bbd8ede3d5da64f5146ee961c86eb957957828e414b81
config.json4.37 KB6c308b31eada6d62eeb2f4d3d7efb4dd094ebe8a89992a2fcd54a3cd8558ba1c
generation_config.json161 Bdc003f3291366156bb46b17ba24f6c212774412a646b2bfb83fa7bac0e296c77
model-00001-of-00002.safetensors5.00 GBea32f178375c21412ee2829b2389682544ecd6f990a6120b219e065b1500d085
model-00002-of-00002.safetensors503 MB5b642fe2ce0ad3ff30838a3daebb6d26252770c65d29306a809e05598fc0e393
model.safetensors.index.json56.5 KB7a1efccef236dea0c422e37d1584fa27b28c3dea5a09a98e2d6ef53c83a4830c
preprocessor_config.json107 Bef824d8f3f414c73cf63f2005deeaabee79fa91ad9b882b35d653fb296903116
special_tokens_map.json629 Bb4858d44e300e3ee192731fd9e2e4ad2a4a77b2fdebc5825ffb0dcd7005f8e04
tokenizer.json8.86 MBdc6c14e44d21900b521716c453225aa9bcb9bb4fa79fd7d0915da47fa8911469
tokenizer_config.json1.43 MB4d8bb069d946acd2b843e50cf287c4059c327a8af3dcdfd3fd609e1717ca1f55
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
edf7d312d2 pinned now2026-11-15 03:51 UTC12 files · 5.51 GB

Use it

$ fw get microsoft/kosmos-2.5-chat
# manifest sha256 28dbd3e9a420… · 5.51 GB · 12 files
$ fw verify ./kosmos-2.5-chat microsoft/kosmos-2.5-chat
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/microsoft/kosmos-2.5-chat.json --dir ./kosmos-2.5-chat $ python3 fw.py verify ./kosmos-2.5-chat ./microsoft__kosmos-2.5-chat.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/kosmos-2.5-chat --revision edf7d312d213f1a4a4645b0a46cffea3575ea016 --local-dir ./kosmos-2.5-chat
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModelForImageTextToText, AutoProcessor processor = AutoProcessor.from_pretrained("microsoft/kosmos-2.5-chat", revision="edf7d312d213f1a4a4645b0a46cffea3575ea016") model = AutoModelForImageTextToText.from_pretrained("microsoft/kosmos-2.5-chat", revision="edf7d312d213f1a4a4645b0a46cffea3575ea016", device_map="auto")
vLLMServe an OpenAI-compatible API.
$ HF_ENDPOINT=https://freeweights.allternit.com vllm serve microsoft/kosmos-2.5-chat --revision edf7d312d213f1a4a4645b0a46cffea3575ea016

License

Name
MIT License
Id
MIT
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
c98ea84958beb923bc4cc02efe3d385061d63ebbe95b51d47da842563767838c
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: microsoft <huggingface.co/microsoft>Newsgroups: alt.freeweights.textSubject: kosmos-2.5-chatDate: 2026-11-15Commit: edf7d31Signed: 2DC28CC7B26A283B ✓
Upstream
microsoft/kosmos-2.5-chat
Pinned commit
edf7d312d213f1a4a4645b0a46cffea3575ea016
Manifest
kosmos-2.5-chat.json · .minisig
Manifest sha256
28dbd3e9a420fcd7b9abbb8119f13664f7414cdfec3a1baf36b581419a3f5f70
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 03:51 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/microsoft/kosmos-2.5-chat.json $ curl -O https://freeweights.allternit.com/manifests/microsoft/kosmos-2.5-chat.json.minisig $ minisign -Vm kosmos-2.5-chat.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

No related models in this catalog.Nothing here lists this model as its parent, and it names no parent.
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/kosmos-2.5-chat
Open in Freeweights Studio

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

Signed manifest
minisign, key 2DC28CC7B26A283B. kosmos-2.5-chat.json. Provenance. Takedown history: none.
From: laion <huggingface.co/laion>Subject: a2-rl-e2egit_large-50-32B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-large-15-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-v2-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_pymethods2test-large-80-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_unitsyn-python-large-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_mix_h2_language_proportional-65-8B