magika (google/magika)

Searching Database…

18.9K ·GitHub
What is this?Magika is an AI-powered file type detection tool: a small deep learning model (a few MB) identifies what a file actually is within milliseconds, even on a single CPU.
Is it a command-line tool, a library, or both?Both: a CLI written in Rust, a Python API, plus bindings for Rust, JavaScript/TypeScript (an experimental npm package) and Go (work in progress).
Do I need Python installed to use it?No. The CLI is a Rust binary you can get through brew or the installer script; Python is only needed if you want to call it as a Python module instead.
What does it return when it isn't confident about a file?A per-content-type threshold system decides whether to trust the model or fall back to generic labels like 'Generic text document' or 'Unknown binary data'; prediction modes (high-confidence, medium-confidence, best-guess) tune error tolerance.
Can I try it before installing anything?Yes - there's an official web demo that runs Magika locally in your browser, so you can see detections without installing the CLI or any package.
Who uses Magika in production?Google routes Gmail, Drive and Safe Browsing files through it to pick the right security and content-policy scanners, processing hundreds of billions of samples weekly. VirusTotal and abuse.ch have also integrated it.
Is it an official Google project?Despite living under the google GitHub org and running at Google scale, the disclaimer says it is not an official Google project and is not supported or warranted by Google.
Creator
google
Size
227.4 MB
Stars
18.9K
Age
3y
Commits · 90 Days