Model reference · open weights
METAGENE-1 is an open-weight embedding model from metagene-ai. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | metagene-ai |
|---|---|
| Type | Embedding models |
| Task | Embeddings |
| Parameters (lead) | 6.5B |
| Context | 512 tokens |
| Runs with | transformers |
| Released | 2024-12-29 |
| Popularity | 1k downloads / month |
| Licence | Open weights |
About
METAGENE-1 is a 7B parameter metagenomic foundation model designed for pandemic monitoring, trained on over 1.5T base pairs of DNA and RNA sequenced from wastewater. It is presented in the paper METAGENE-1: Metagenomic Foundation Model for Pandemic Monitoring.
https://metagene.ai
METAGENE-1 is a 7-billion-parameter autoregressive transformer language model, which we refer to as a metagenomic foundation model, that was trained on a novel corpus of diverse metagenomic DNA and RNA sequences comprising over 1.5 trillion base pairs. This dataset is sourced from a large collection of human wastewater samples, processed and sequenced using deep metagenomic (next-generation) sequencing methods. Unlike genomic models that focus on individual genomes or curated sets of specific species, the aim of METAGENE-1 is to capture the full distribution of genomic information present across the human microbiome. After pretraining, this model is designed to aid in tasks in the areas of biosurveillance, pandemic monitoring, and pathogen detection.
We carry out byte-pair encoding (BPE) tokenization on our dataset, tailored for metagenomic sequences, and then pretrain our model. We detail the pretraining data, tokenization strategy, and model architecture, highlighting the considerations and design choices that enable the effective modeling of metagenomic data, in our technical report.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("metagene-ai/METAGENE-1")
model = AutoModelForCausalLM.from_pretrained("metagene-ai/METAGENE-1", torch_dtype=torch.bfloat16, device_map="auto")
# Example input sequence
input_sequence = "TCACCGTTCTACAATCCCAAGCTGGAGTCAAGCTCAACAGGGTCTTC"
# Tokenize the input sequence and remove the [EOS] token for generation
input_tokens = tokenizer.encode(input_sequence, return_tensors="pt", add_special_tokens=False).to(model.device)
# Generate output from the model
generated_tokens = model.generate(input_tokens, max_length=32)
# Decode the generated output and clean up the result
generated_sequence = tokenizer.decode(generated_tokens[0], skip_special_tokens=True)
generated_sequence = generated_sequence.replace(" ", "").replace("_", "")
# Generated output: A Hexamita inflata 5.8S ribosomal RNA gene sequence
print(f"🔬 Generated Sequence:\n{generated_sequence}")
# TCACCGTTCTACAATCCCAAGCTGGAGTCAAGCTCAACAGGGTCTTCTTGCCCCGCTGAGGGTTACACTCGCCCGTTCCCGAGTCTGTGGTTTCGCGAAGATATGACCAGGGACAGTAAGAACC
We evaluate METAGENE-1 across three tasks: pathogen detection, zero-shot embedding benchmarks (Gene-MTEB), and genome understanding (GUE), achieving state-of-the-art performance on most benchmarks. For more details, check out our paper.
The pathogen detection benchmark evaluates METAGENE-1’s ability to classify sequencing reads as human pathogens or non-pathogens across four distinct datasets, each derived from different sequencing deliveries and designed to mimic real-world conditions with limited training data.
| DNABERT-2 | DNABERT-S | NT-2.5b-Multi | NT-2.5b-1000g | METAGENE-1 | |
|---|---|---|---|---|---|
| Pathogen-Detect (avg.) | 87.92 | 87.02 | 82.43 | 79.02 | 92.96 |
| Pathogen-Detect-1 | 86.73 | 85.43 | 83.80 | 77.52 | 92.14 |
| Pathogen-Detect-2 | 86.90 | 85.23 | 83.53 | 80.38 | 90.91 |
| Pathogen-Detect-3 | 88.30 | 89.01 | 82.48 | 79.83 | 93.70 |
| Pathogen-Detect-4 | 89.77 | 88.41 | 79.91 | 78.37 | 95.10 |
The Gene-MTEB benchmark evaluates METAGENE-1’s ability to produce high-quality, zero-shot genomic representations through eight classification and eight clustering tasks.
| DNABERT-2 | DNABERT-S | NT-2.5b-Multi | NT-2.5b-1000g | METAGENE-1 | |
|---|---|---|---|---|---|
| Human-Virus (avg.) | 0.564 | 0.570 | 0.675 | 0.710 | 0.775 |
| Human-Virus-1 | 0.594 | 0.605 | 0.671 | 0.721 | 0.828 |
| Human-Virus-2 | 0.507 | 0.510 | 0.652 | 0.624 | 0.742 |
| Human-Virus-3 | 0.606 | 0.612 | 0.758 | 0.740 | 0.835 |
| Human-Virus-4 | 0.550 | 0.551 | 0.620 | 0.755 | 0.697 |
| HMPD (avg.) | 0.397 | 0.403 | 0.449 | 0.451 | 0.465 |
| HMPD-single | 0.292 | 0.293 | 0.285 | 0.292 | 0.297 |
| HMPD-disease | 0.480 | 0.486 | 0.498 | 0.489 | 0.542 |
| HMPD-sex | 0.366 | 0.367 | 0.487 | 0.476 | 0.495 |
| HMPD-source | 0.451 | 0.465 | 0.523 | 0.545 | 0.526 |
| HVR (avg.) | 0.479 | 0.479 | 0.546 | 0.524 | 0.550 |
| HVR-p2p | 0.548 | 0.550 | 0.559 |
From the published model card. Full card on the HuggingFace links in the sidebar.
Using it via the API
Once AxForge deploys metagene-1 for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (metagene-1 below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/embeddings \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"metagene-1","input":"text to embed"}'
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.