Is-even-ai – Check if a number is even using the power of AI
164 comments
·May 20, 2025s1mplicissimus
1k
This exactly. It is more important to move fast. Screw the edge cases. As long as it’s correct _most_ of the time, you can always fix anything that’s broken tomorrow.
pavel_lishin
It's called "eventual consistency".
sho_hn
And C10k was never about those 10.000 socket connections getting the right response, either!
whatever1
Why on earth did the software engineering interviews were checking candidates’ ability to think about edge cases? Clearly management does not care.
sho_hn
Developers who aren't using it are already falling behind.
SamBam
Remember, it's not that AI that will take your job, it's the developers who need an AI to tell them if a number is even that will take your job.
darepublic
pro tip: play around with the temperature especially when using big numbers as input
hzambo
Wow, amazing tip. This hack improved my workflow by 10x.
Waterluvian
Only 9x for me. What am I doing wrong? Can you share your vscode colour scheme file?
koakuma-chan
Are there actually still Junior Developers out there? I thought no one is hiring Junior Developers.
ArthurStacks
Its actually the opposite of how people think.
We hire junior devs, but not senior, and dont replace our senior devs. So our developer base is moving towards being junior weighted with less senior. The reason being a junior dev is cheaper, complains less, is more capable now through utilising generative AI, works harder to impress knowing they arent in a safe position, and we can let them go more easily with less process and less reasons needed to be given.
NoGravitas
It is legitimately hard to tell if this is a parody account.
android521
you're so wrong. This only works if what you do is so simple that any junior develper can sufficiently do it well. Senior developers with AI is gonna destroy a bunch of junior developers with AI.
echelon
You laugh now, but our jobs are going to be toast in 10 years.
I thought self-driving would never happen, and now it's here.
margalabargala
Almost here. Elon said Full Self Driving would mean full self driving within a year! That means we are less than 12 months away from not needing to drove ourselves anymore.
echelon
I was talking about Waymo. It's real and it's spreading everywhere.
Give it another 10-20 years and your job will probably face the same fate.
null
iamthemonster
This is pretty useless to be honest. It's good for telling whether a number is even, but in our industry we need more powerful functionality. We also need to know whether a number is odd.
charles_f
RTFM, it's not only implementing isOdd but also a large set of rarely used advance operations such as isEqual, or isGreaterThan
Trully AI is astonishing
whynotmaybe
Why a specific function ?
With a few lines of code, you can just create a list with all the numbers that are even and when you need to check if a number is odd, you simply have to check if it's in the list.
turnsout
Yes, this is what we do as a RAG workflow. We created a list of all 32bit unsigned integers and whether they were even or odd, and we pass that into the context. The future is amazing!
MikeTheGreat
I'm new to RAG and have a question: how do you get all the numbers into the context window?
Does the RAG part look up just the needed number?
I think that Gemini has a million token window (yes?) - do you have access to a model with a larger window?
Regardless, I find your ideas intriguing and wish to subscribe to your Substack.
int_19h
Have you tried quantizing them down to 4 bits to save on RAM?
Charon77
I.. can't tell if you're joking or not. Pretty sure someone out there is unironically doing something as stupid as this in production
sureIy
Do we have enough spaces in the ALL_NUMBERS array or do we want to group them by thousands?
ALL_NUMBERS_00001
ALL_NUMBERS_00002
kaibee
Yeah, some of the bigger numbers were a problem, so we switched to using a horizontally scaling db cluster so that we could cover all of the (useful) numbers. When we encounter a new number, it gets routed to the appropriate db where the results of the function are cached after being calculated. We're thinking of spinning it off as an API service actually if there's any interest.
iamthemonster
we fired all our junior devs so we can't write code any more
briansm
"This is pretty useless to be honest."
I remember saying that about Bitcoin 15 years ago.
crubier
You can achieve this super simply this by prompting the OpenAI API to call this tool and reverse the output.
YokoZar
Great news! The package includes an isOdd function as well!
nbittich
isn't it breaking the one package one responsibility principle?uncle bob wouldn't be happy, it doesn't seem clean
Cerium
Simply add one to the number and then test it again.
avandekleut
Someone should implement this using tool calls.
bosky101
Sorry for the offtopic post, but I am looking to hire someone with 10 years of experience with is-even-ai. Urgent. Your first unpaid assignment will be to help load balance a bunch of MCP servers to add and THEN check if it's even. So much to go from here! We're a single threaded GPU first identity operator company with a lot history of returning the same thing. We're now expanding to combine and add multiple things. In 6 months of SOTA fine tuning we can already add upto 3 numbers. An MCP first. With temperature 1 we even add random numbers. An industry first. And we're just getting started. Join us. We're adding to our team!
66yatman
This is a joke right?
aubanel
Certainly not, it's actually possible to add 3 float32 numbers with 90% precision using AI! With a recent breakthrough, the team is working on pushing that to 10, we have enough cracked engineers to hope to make it happen soon!
Joker_vD
By "10", you mean "10% precision", or "10 float32 numbers"?
bosky101
"Karen, can you print, scan and mail me a copy of our NDA policy for our non-external internal employees"
thiht
> I am looking to hire someone with 10 years of experience with is-even-ai
is-even-ai is only 7 month old so 10 years of experience is impossible, this is clearly a joke!
aubanel
No it's not for a 17.1428x engineer like me!
tasuki
If I were a hiring manager and saw your comment, I wouldn't hire you. Could it have been a joke in a more obvious way? Do you think all the other comments here are serious?
hyperhello
The parent comment was perfectly clear. Please familiarize yourself with the rules of the website that you are looking at.
parpfish
Use this to add AI to your product to appease management.
Next week, “refactor” it out and brag to manager about cost savings and performance boosts, don’t mention “removing the AI”.
lrvick
NPM packages can never be removed once added to a codebase. You can only add more.
freetime2
Boss: What have you been working on for the last quarter?
Me: I leveraged Deep Intelligence to build a Next-Gen Parity Classifier with 99.9% accuracy.
rthnbgrredf
Smart Boss: And what did you actually do?
mitthrowaway2
Is there a version I can run locally? I don't want OpenAI training on my integers.
avs733
you need the roomHeater fork. It uses the Climate Change 1.5C license
johnisgood
Why? Do you have anything to hide?[1].
bosky101
Rofl
thiht
I have a few qualms with this library:
1. For an AI engineer, you can already build such a system yourself quite trivially by fine-tuning a lightweight inference model, deploying it behind a FastAPI endpoint, and orchestrating requests with a custom prompt pipeline. If you want to go further, you could even ensemble multiple LLMs for higher evenness accuracy.
2. It doesn't actually replace the modulo operator. Most people I know just use `n % 2 === 0` to check if a number is even, and they still keep that knowledge handy in case the AI service is down. This does not solve the reliability issue.
3. It does not seem very "viral" or income-generating. I know this is premature at this point, but without charging users for the library, is it reasonable to expect to make money off of this?
nbittich
I don't think you can do 1. without distilling & quantization
jasonjmcghee
You might be able to optimize this by using embeddings. Store all the numbers and search "odd" and "even" until you find your number.
asidiali
This hit way too close to home, I’m cackling.
ukuina
This doesn't work if I use a reasoning model like o3, which does not allow setting max_tokens.
Without reasoning, how can I be SURE a number is even?
parpfish
I think before you would deploy this to prod, you should wrap it with a few guardrails to make sure it’s not hallucinating. Pretty simple — just take the output from the llm and see if it agrees with a simple mod2 operation.
Of it agrees, return model output to the user. Otherwise do a couple of retries with different prompts.
mrheosuper
mod2 is outdated and has not been updated for years, nobody uses it anymore
hartator
Multiple models?
ashton314
…but there’s only one dependency!! This goes against the NPM ethos of importing anything and everything that you might be tempted to just handle yourself. I’ll be waiting for the Enterprise Version that uses the appropriate number of dependencies.
kevinventullo
This is never going to scale. Eventually we’re going to run out of numbers which have been manually checked for evenness by a human, and instead the training data for the checks will be polluted by numbers which have only been verified by computers.
jwillp
Training computers on human stupidity has got to be infinitely scalable, by induction.
alexitosrv
This is the best chain of comments in a HN thread in a long time. Happy to see the hacker spirit strong!
This package has saved me so many hours of tedious gruntwork. It's like a junior developer - you still have to manually check their work, but when it's correct, it's a great productivity improvement.
And don't forget where this will go in a couple years with improved models and more computing power, it's gonna be awesome!
[/i]