AWS Builder Center
Jevs for everything, everywhere... all at once

Jevs for everything, everywhere... all at once

What happens when one Jev is not enough? PolyJev explores how small, composable Jevs for all modalities can be combined, nested, and deployed into increasingly elaborate systems, because apparently ordinary software was not recursive enough.

Haaaaaave you met Jev?

Everyone is talking about Jev.
Jev this, Jev that. Jevs are classifiers. Jevs are decision models. Jevs are the next big thing that has already passed.
Take a generative model, give it a fixed set of choices, look at the logits for those choices, turn them into probabilities. That's Jev.
The idea is so simple that you can easily create your own Jev with just a few lines of code cf.  Jev in X LoC :
# /// script
# dependencies = ["huggingface-hub", "llama-cpp-python"]
# ///
import math
from llama_cpp import Llama
# Load the model
m = Llama.from_pretrained("Qwen/Qwen3-0.6B-GGUF", "Qwen3-0.6B-Q8_0.gguf", logits_all=True, verbose=False)
# Format the choices
choices = {"A": "Legitimate", "B": "Spam", "C": "Phishing"}
opts = "\n".join(f"{k}. {v}" for k, v in choices.items())
# Define the input
email = "Payroll asks for your password on a non-company sign-in page."
# and run the model
m.eval(m.tokenize(f"<|im_start|>system\nChoose one option.<|im_end|>\n<|im_start|>user\nEmail: {email}\n\n{opts}<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n".encode(), add_bos=False, special=True))
# Get a score for each choice
z = {v: math.exp(m.scores[m.n_tokens - 1][m.tokenize(k.encode(), add_bos=False)[0]]) for k, v in choices.items()}
# Turn the scores into probabilities
print({k: round(v / sum(z.values()), 3) for k, v in z.items()})
You can use Jevs for classification, routing, ranking, preference estimation, evaluation, or basically any task where you want a dumbed-down generative model to choose among a fixed set of options.
And if one Jev is useful, why not 2**n - 1, where n = #{text 📝, image 🖼️, audio 🔊, and video 🎬}, one for each modality and modal combo?
Text? Jev! Image+Audio? Jev! Video? You guessed it... Jev!
It's Jevs all the way down... 🐢

From Jev to PolyJev

Once you have a Jev for text, a natural question to ask is
What if the input isn't text?
Maybe I have:
  • 📝 an email
  • 🖼️ a screenshot
  • 🔊 a voicemail
  • 🎬 a screen recording
Or, because real-world inputs apparently enjoy making things complicated, several of these at once.
That's when  PolyJev   comes in... 

It provides a Jev for each possible combination of text 📝, image 🖼️, audio 🔊, and video 🎬.
That's 15 Jevs (... all serverless. Each has its own image running on its own dedicated Lambda function ( polyjev-{modality_combo} ).

Why Lambda?

Well... because it's fun. But also because this architecture has a couple of interesting properties:
  • The weights are downloaded at build time, so cold start doesn't need to fetch model weights from somewhere else
  • The container image is streamed from Amazon ECR and the GGUF weights are memory-mapped from somewhere else
  • The model itself is loaded on the first invocation
Because Lambda allocates vCPUs proportionally to memory, giving the function more memory also gives the CPU-bound forward pass more compute.
The trade-off is, of course, cost. No free lunches here... sorry!

What about the models?

PolyJev currently uses different GGUF models depending on the modality.
For example, text Jev uses Qwen3-1.7B, while multimodal workloads use models such as SmolVLM2-500M-Video or Gemma 4 E2B, so memory requirements vary quite a bit.
The repository measures the require memory and leaves some headroom in each Lambda configuration.
There is also a practical wrinkle here: new AWS accounts can initially have a lower Lambda memory quota (see e.g.  How to increase Lambda memory above 3008 MB | AWS re:Post ).
If that happens, PolyJev has a convenient escape hatch:  just max_mb=3008 deploy all  or whatever limit you have in place.
Even Jevs have to deal with quotas.

Multimodal Jevs are weird... and fun 👀

Text is a breeze. Image classification is still pretty straightforward.
But once we start combining modalities, things become much more interesting.
Consider:
"Does this screenshot reproduce the bug described in this ticket?"
"Did the customer confirm the order in their voice message?"
"Does the spoken price match the price displayed in the advertisement?"
PolyJev includes examples for all of these.
One of my favourites is the all-modalities-under-the-sun case.
The demo task is incident severity i.e.  SEV1  (we're doomed),  SEV2  (we're still screwed),  SEV3  (maybe it'll will solve itself if we leave it alone).
The input can contain an alert, a dashboard screenshot, a narrated status page, and a video.
One forward pass later:
SEV1 0.72
SEV2 0.24
SEV3 0.04
Again: the model doesn't need to explain itself.
It just needs to choose.

Video is particularly fun 🎬

For the video Jevs, PolyJev samples X frames evenly across the clip.
For combinations involving audio, the soundtrack is extracted separately using  ffmpeg .
It's obviously not the only way to reason about video, but it's a wonderfully simple one for a demo.
And it keeps the rest of the architecture pleasantly booooooooooring.

Jevs all the way down 🐢

There's something slightly recursive about this whole thing.
We start with a generative model.
We use its logits to build a classifier.
We package the classifier as a Lambda function.
We put those functions behind an API, and our demo app in from of it.
And suddenly we have a serverless setup for models whos entire job is to answer 'A, B, or C?' type questions.
It's almost comically constrained... and that's precisely what I like about it.
Generative AI has trained us to think in terms of increasingly elaborate prompts and sycophantically verbose outputs... Jevs go in the opposite direction.
It goes to show that you don't always need a model to write. Sometimes you just need it to choose.

What I learned / remembered from building this

A few things stood out while putting PolyJev together with a little help from my friend Claude:

1. Multimodality is mostly an interface problem

Once the underlying model can process multiple modalities, the interesting engineering question becomes:
How do I make the input contract predictable?
 Jev[Text, Image, Category]  is a surprisingly useful abstraction.
It makes the modality combination explicit without making the app care about the underlying model implementation.
Who cares about the model these days?

2. Serverless ML doesn't mean 'tiny' models

Lambda is often associated with small functions doing very small things.
But container images + configurable memory make it possible to experiment with a surprisingly large subset of models.
Instead of
Can Lambda run this?
ask
What latency / cost envelope am I willing to accept?

3. Constrained outputs can simplify everything downstream

If the model can only return one of  N  known answers, a whole class of application problems disappears.
No more parsing generated prose, or retries because the model invented a new label.
No more wondering whether  "phishing"  and  "phish"  are supposed to mean the same thing.
The output space is the contract.

What's next? 🚀

There are plenty of things we can experiment with e.g.
  • better batching
  • more efficient video sampling
  • calibration of resulting probabilities
  • larger and smaller models
  • more modalities
  • task-based (Jev-based?) model routing
  • &c. &c.
And, naturally, finding increasingly ridiculous things to classify.
The whole project is available on GitHub:
Clone it, pick a Jev, and start experimenting:
git clone https://github.com/JGalego/PolyJev
cd PolyJev
uv sync
make local JEV=text-image
or go all the way
just deploy all
The demo app includes examples covering emails, charts, voicemails, receipts, screen recordings, delivery footage, support tickets, advertisements, and incident reports.
All powered by Jevs.
For everything.
Everywhere.
All at once.

References 📚

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article