Skip to main content

Flux: A machine learning model-definition framework developed by Orvex Research.

Project description

Flux

Version License Orvex Research


Flux acts as the core model-definition framework for state-of-the-art machine learning with text, computer vision, audio, video, and multimodal models, for both inference and training.

It is developed and maintained by Orvex Research, providing a centralized, eco-system-wide framework. flux is the pivot across frameworks: if a model definition is supported, it is fully compatible with the majority of training frameworks (Axolotl, Unsloth, DeepSpeed, FSDP, PyTorch-Lightning, ...), inference engines (vLLM, SGLang, TGI, ...), and adjacent modeling libraries (llama.cpp, mlx, ...).

We pledge to help support new state-of-the-art models and democratize their usage by having their model definition be simple, customizable, and efficient.


🚀 Why Use Flux?

  1. Easy-to-use State-of-the-Art Models:

    • High performance on natural language understanding & generation, computer vision, audio, video, and multimodal tasks.
    • Low barrier to entry for researchers, engineers, and developers.
    • Few user-facing abstractions with just three classes to learn.
    • A unified API for using all our pretrained models.
  2. Lower Compute Costs, Smaller Carbon Footprint:

    • Share trained models instead of training from scratch.
    • Reduce compute time and production costs.
    • Hundreds of model architectures with 1M+ pretrained checkpoints across all modalities.
  3. Choose the Right Framework for Every Phase:

    • Train state-of-the-art models in 3 lines of code.
    • Move a single model between PyTorch/JAX/TF2.0 frameworks at will.
    • Pick the right framework for training, evaluation, and production.
  4. Easily Customize to Your Needs:

    • Model internals are exposed as consistently as possible.
    • Model files can be used independently of the library for quick experiments.

📦 Installation

Flux requires Python 3.10+ and PyTorch 2.4+.

1. From PyPI

# Using pip
pip install "flux[torch]"

# Using uv
uv pip install "flux[torch]"

2. From Source

git clone https://github.com/Orvex-Research/Flux.git
cd Flux

# Using pip
pip install -e '.[torch]'

# Using uv
uv pip install -e '.[torch]'

📖 Quickstart Guide

Get started with Flux right away using the Pipeline API. The Pipeline is a high-level inference class that handles preprocessing, model forwarding, and returning clean predictions.

1. Text Generation

from flux import pipeline

# Instantiate a pipeline and specify a model
generator = pipeline(task="text-generation", model="Qwen/Qwen2.5-1.5B")
response = generator("the secret to baking a really good cake is ")
print(response)

2. Multi-turn Conversational Chat

You can chat with models programmatically or directly from your terminal:

flux chat Qwen/Qwen2.5-0.5B-Instruct

Or via the Python API:

import torch
from flux import pipeline

chat = [
    {"role": "system", "content": "You are a helpful assistant developed by Orvex Research."},
    {"role": "user", "content": "Tell me three fun things to do in New York."}
]

generator = pipeline(task="text-generation", model="meta-llama/Meta-Llama-3-8B-Instruct", dtype=torch.bfloat16, device_map="auto")
response = generator(chat, max_new_tokens=512)
print(response[0]["generated_text"][-1]["content"])

3. Speech Recognition

from flux import pipeline

asr = pipeline(task="automatic-speech-recognition", model="openai/whisper-large-v3")
result = asr("https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac")
print(result)
# {'text': ' I have a dream that one day this nation will rise up and live out the true meaning of its creed.'}

4. Image Classification

from flux import pipeline

classifier = pipeline(task="image-classification", model="facebook/dinov2-small-imagenet1k-1-layer")
result = classifier("https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png")
print(result)

🎨 Supported Modalities & Models

Flux supports a wide range of architectures. Here are some featured models for various use cases:

🎙️ Audio

  • Audio Classification: CLAP
  • Automatic Speech Recognition: Parakeet, Whisper, GLM-ASR, Moonshine-Streaming
  • Keyword Spotting: Wav2Vec2
  • Speech to Speech Generation: Moshi
  • Text to Audio/Speech: MusicGen, CSM

👁️ Computer Vision

  • Automatic Mask Generation: SAM
  • Depth Estimation: DepthPro
  • Image Classification: DINO v2
  • Keypoint Detection & Matching: SuperPoint, SuperGlue
  • Object Detection: RT-DETRv2
  • Pose Estimation: VitPose
  • Universal Segmentation: OneFormer
  • Video Classification: VideoMAE

🤝 Multimodal

  • Audio/Text to Text: Voxtral, Audio Flamingo
  • Document Question Answering: LayoutLMv3
  • Image/Text to Text: Qwen-VL, Llava-OneVision
  • Image Captioning & OCR: BLIP-2, GOT-OCR2
  • Table Question & Answering: TAPAS
  • Visual Question Answering: Llava, Kosmos-2

📝 NLP (Natural Language Processing)

  • Masked Word Completion: ModernBERT
  • Named Entity Recognition: Gemma
  • Question Answering & Summarization: Mixtral, BART
  • Translation: T5
  • Text Generation: Llama, Qwen

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orvex_flux-5.10.0.tar.gz (9.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orvex_flux-5.10.0-py3-none-any.whl (12.2 MB view details)

Uploaded Python 3

File details

Details for the file orvex_flux-5.10.0.tar.gz.

File metadata

  • Download URL: orvex_flux-5.10.0.tar.gz
  • Upload date:
  • Size: 9.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for orvex_flux-5.10.0.tar.gz
Algorithm Hash digest
SHA256 215e74c64d97ce0e39c2fc5523394f548df0afeb0081e42e1da942da8046e050
MD5 704488186357cc64f9422fc5af2fee4e
BLAKE2b-256 d84512d1e3361f7835e8a4d2923e6b08d4c991192a62860d9f8a7fd52a5433ad

See more details on using hashes here.

File details

Details for the file orvex_flux-5.10.0-py3-none-any.whl.

File metadata

  • Download URL: orvex_flux-5.10.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for orvex_flux-5.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85057724dfa3b9ce009ffee4f965327f24352270e4243d7de32adeee7e9b9b5e
MD5 0117b92ca3e31682fbb1ebece407279c
BLAKE2b-256 f106a6c0e8ad3876fa3fe4e9a066fb65048aaac1e7c94cd2217279152cb253a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page