MULTIMODAL ROUTER — OPEN SOURCE (MIT)

funcroute

Gives a text-only model
eyes, ears and a
filing cabinet.

The Problem

Multimodal is a configuration tax. Everyone wants it, nobody wants to pay for it. Your client sends one model name — but images need a vision model, audio needs an omni model, and text should stay on the cheap model. Every workaround has a catch: paying vision prices for JSON, splitting providers and breaking conversations, or hardcoding routing into your application.

funcroute is a small C router that sits between your client and your model providers. It inspects the request body, picks the right upstream by content type, rewrites the model field, forwards the request, and translates the answer back. Your client never finds out a different model answered.

your client
    ▶ funcroute
        ├──▶ deepseek-v4-flash
        │      (text)
        ├──▶ deepseek-v4.1-flash
        │      (images, PDFs)
        └──▶ qwen-omni-flash
             (audio)

How It Works

request in
  ↓
  walk content parts
  ↓
  pick provider by kind
  │  text     → cheap model
  │  image    → vision model
  │  file     → vision model
  │  audio    → omni model
  ↓
  rewrite model field
  ↓
  forward + translate
  ↓
  reply to client

Attachments travel inline as base64 data URLs. funcroute never opens a file and accepts no multipart uploads — the bytes come off the stream. The router also trims conversation history to fit your configured budget without ever dropping a message that carries an attachment.

Routing Table (shipped config)

Request contains   Goes to          Model
────────────────────────────────────────
nothing special    DeepSeek       deepseek-v4-flash
image_url part    OpenRouter     deepseek-v4.1-flash
file part        OpenRouter     deepseek-v4.1-flash
input_audio part  OpenRouter     qwen-omni-flash

The router picks the specialist for the most restrictive content kind in the request, ordered audio > file > image, on the grounds that whatever gets picked has to be able to read everything in the body. The omni model reads images and PDFs too, so it can take an image and a voice memo at once.

Measured Numbers

Request            Routed to    Wall clock
───────────────────────────────────
text only        deepseek     1014 ms
4 KB image      deepseek-vl  1237 ms
600 B PDF       deepseek-vl  2028 ms
1 s WAV         qwen-omni   2471 ms
image + WAV     qwen-omni   2992 ms
image streamed   deepseek-vl  1909 ms

The useful part of that table is the routing column, not the latency. Every audio-bearing row went to a different vendor than every text-only row, and the client asked for the same model name throughout.

Why funcroute

One model name

Your client sends one URL and one model name. funcroute rewrites the model field per request — the client never knows a different model answered.

~4,000 lines of C

Five pkg-config dependencies, no vendored code. One binary, no runtime. Starts in milliseconds. Read it all in a sitting.

OpenAI + Ollama

Speaks both dialects. Translates between them transparently. No matter which client you use, funcroute handles the conversion.

Conversation trimming

Trims history to fit budget without dropping a message that carries an attachment. Tool call groups are kept atomic.

No dependencies

Not an inference engine, not a proxy for your whole stack, not a load balancer. It does one thing: route by content type.

MIT licensed

Free and open source. Build it, ship it, embed it. One JSON config file. No dashboards, no services, no DSL.

Positioning: funcroute vs Sokka

Both route model traffic, but they answer different questions. funcroute looks at what is attached to a request — image, audio, file — and picks a specialist model that can read it. Sokka looks at what the request is asking and applies task classification, complexity estimation, and cost/latency/quality policy.

They compose. Run funcroute behind Sokka and a request gets both content-aware model selection and full routing policy. funcroute is the open-source edge router; Sokka is the commercial control plane.

funcroute  (open source)
  content-aware → specialist model
Sokka  (proprietary)
  task-aware → policy-driven model
Together
  right model, every request

Open Source

funcroute is MIT-licensed and available on GitHub. Build from source with make — the only dependencies are libcurl, libjq, and a few standard system libraries.

$ git clone https://github.com/SpaceSwordAI/funcroute
$ cd funcroute && make
[...]
✓ funcroute built

$ ./funcroute
listening on http://127.0.0.1:8080

Limitations

funcroute is not an inference engine, a load balancer, or a way to make an expensive model cheap. It does not do prompt rewriting, semantic routing, caching, budgets, retries, or load balancing across keys. It does one thing: pick an upstream by content type. For the grown-up features, consider running funcroute behind LiteLLM, Portkey, or Sokka. funcroute is a personal tool that turned out to be reliable enough to publish — not a product for every team.