Skip to content

msgFlux

An open-source framework for building multimodal AI applications { .subtitle }

:material-rocket-launch: Get Started :material-book-open: Documentation

pip install msgflux

Core Principles

  • Privacy First


    msgFlux does not collect or transmit user data. All telemetry is fully controlled by the user and remains local, ensuring data sovereignty and compliance.

  • Designed for Simplicity


    Core building blocks—Model, DataBase, Parser, and Retriever—provide a unified and intuitive interface to interact with diverse AI resources.

  • Powered by Efficiency


    Leverages high-performance libraries like Msgspec, Uvloop, Jinja, and Ray for fast, scalable, and concurrent applications.

  • Practical


    Workflow API inspired by torch.nn, enabling seamless composition with native Python. Advanced versioning and reproducibility out of the box.


High-Level Modules

msgFlux introduces a set of high-level modules designed to streamline multimodal inputs and outputs. These modules encapsulate common AI pipeline tasks:

  • Agent


    Orchestrates multimodal data, instructions, context, tools, and generation schemas. The cognitive core of complex workflows.

  • Speaker


    Converts text into natural-sounding speech, enabling voice-based interactions.

  • :material-text-to-speech:{ .lg } Transcriber


    Transforms spoken language into text, supporting speech-to-text pipelines.

  • Designer


    Generates visual content from prompts and images, combining textual and visual modalities.

  • Retriever


    Searches and extracts relevant information based on queries, ideal for grounding models in external knowledge.

  • Predictor


    Wraps predictive models (e.g., scikit-learn) for smooth integration into larger workflows.


Quick Example

from msgflux.models import ChatCompletion

model = ChatCompletion(provider="openai", model="gpt-4")

response = model.call(
    messages=[{"role": "user", "content": "Hello!"}]
)

print(response.content)
from msgflux.models import TextEmbedder

embedder = TextEmbedder(provider="openai")

embeddings = embedder.call(
    texts=["Hello world", "msgFlux is awesome"]
)

print(embeddings.shape)
from msgflux.models import TextToSpeech

tts = TextToSpeech(provider="openai")

audio = tts.call(
    text="Hello from msgFlux!",
    voice="alloy"
)

audio.save("output.mp3")
from msgflux.nn import Agent

agent = Agent(
    model="gpt-4",
    instructions="You are a helpful assistant",
    tools=[search_tool, calculator_tool]
)

result = agent("What's the weather in Paris?")
print(result)

Why msgFlux?

Unified Interface

Work with text, vision, speech, and more through a single, consistent API. No need to learn different SDKs for each provider.

Provider Agnostic

Easily switch between OpenAI, Anthropic, Google, Mistral, and more without changing your code structure.

Production Ready

Built-in support for async operations, retries, error handling, and observability. Deploy with confidence.


Ready to Build?