Skip to main content

demuxai

EXPERIMENTAL: this is a work-in-progress, and for local usage. Not for production!

A lightweight proxy that provides a singular OpenAI compatible API for all your AI services.

  • Aggregates upstream APIs' models and prefixes them with a provider ID
  • The provider ID is used to route the request to the upstream provider
  • Before sending the request upstream, the provider ID is stripped from the request

Named after a demultiplexer, takes one input and distributes it to one or more outputs.

Background

I wanted an API proxy that I could configure in my Jetbrains IDE, but not limit me to that provider for all settings. For example, I use a local Ollama model for instant completion, and other providers for chat or agentic tasks. Additionally, there are many free tiers available, so this abstraction layer can implement more advanced routing behaviors to take full advantage of free offerings, without interruption.

Features

Supports the following providers:

  • Ollama
  • Ollama Cloud
  • Github Models
  • Mistral AI (and Codestral)
  • Fireworks AI Serverless

Currently, demuxai has the following capabilities:

  • Legacy completion endpoint
  • Chat completion
  • FIM completion
  • Embedding generation
  • Streaming responses

Planned

The following features are planned:

  • Timing statistics (WIP)
  • Token statistics (WIP)
  • Complete most of the API spec
  • Completion ID routing back to the original provider
  • Round-robin and failover providers
  • Consensus providers to summarize responses from multiple upstream providers
  • Split providers that route to upstream providers based off content type (i.e. python vs JS)
  • Configuration like routedns

Alternatives

  • Need a full-featured proxy or GUI? Checkout bifrost
  • Need more providers? Checkout LiteLLM

Running

Create a config.yml (see config.spec.yml) and run demuxai in the directory of that file, or pass its path as -c /path/to/config.yml. Run demuxai -h to see help information.

demuxai -c /path/to/config.yml

Example config

Export your API keys in environment variables with the names specified in each ${...}. Remove any providers you don't use.

demuxai:
  listen: '127.0.0.1'
  port: 6041
  cache_seconds: 3600
  timeout_seconds: 300

  providers:
    ollama:
      type: ollama
      name: Local Ollama
      description: Local Ollama for testing

    mistral:
      type: mistralai
      name: Mistral AI
      api_key: ${MISTRAL_API_KEY}
      exclude_models:
        - voxtral-*
        - mistral-ocr-*
        - mistral-moderation-*

    codestral:
      type: codestral
      name: Codestral from Mistral AI
      api_key: ${CODESTRAL_API_KEY}

    github:
      type: github
      name: GitHub Models
      api_key: ${GITHUB_TOKEN}

    fireworks:
      type: fireworks
      name: Fireworks AI Serverless
      api_key: ${FIREWORKS_API_KEY}
      exclude_models:
        - accounts/fireworks/models/flux*

AI Disclosure

LLMs were used in the development of this project, mostly for brainstorming and bootstrapping code, particularly tests. The contribution proportion is roughly 80 / 20, human and AI code respectively.

License

MIT :: Copyright 2026 Blaine Jester

Metadata

Release files for demuxai 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for demuxai 0.0.2
File Interpreter ABI Platform
demuxai-0.0.2-py3-none-any.whl Python 3 none any Details

Release files / demuxai-0.0.2-py3-none-any.whl

Download URL demuxai-0.0.2-py3-none-any.whl
Size 34.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc88fd486cece66e294a75950ed69020995347a46578a74d18b6c094ace6277c
BLAKE2b-256 checksum
How to use checksums
2222c90fa407dfb75d47c4d814e6f866de448a44b8da0ca9814b8850ea7b8ec8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 22, 2026.

Transparency log

Security for demuxai 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 1 file in this release has been uploaded with provenance metadata.

Attestation for demuxai-0.0.2-py3-none-any.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page