Hacker News new | ask | show | jobs
by Tcepsa 330 days ago
Maybe it's spite-driven development, but I'd love to hear about someone who, upon learning that LLMs are suggesting endpoints in their API that don't exist, implements them specifically to respond with a status code[0] of "421: Misdirected Request". Or, for something less snarky and more in keeping with the actual intent of the code, "501: Not Implemented". If the potentially-implied "but it might be, later" of 501 is untenable, I humbly propose this new code: "513: Your Coding Assistant Is Wrong"

[0]: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

4 comments

> "513: Your Coding Assistant Is Wrong"

You made me chuckle. Well played. Great stuff :)

May I, simply, also suggest:

HTTP 407 Hallucination

Meaning: The server understands the request but believes it to be incongruous with reality.-

Yes, it should definitely be in the 400 space of HTML error codes. As 400 -> "You are incorrect" while 500 -> "We messed up".
+1 for 513: Your Coding Assistant Is Wrong"

If we have 418, why not 513?

I humbly request, if you are going to do this, please, please...use the 418 response. It deserves wider adoption :-)
Bit of a pet peeve: 418 is clearly defined as "I am a teapot", not "whatever I want it to mean".

Please do not use it for anything other than its specified purpose, even if it is a joke.

If an LLM can hallucinate an endpoint, then the server is allowed to hallucinate being a teapot :)
Is one being a little precious about one being a teapot!?
Are you a teapot? If you were, maybe you'd be precious about people falsely claiming to be one too!
It's really more about how when I say "I am a teapot", I want people to think "Oh, he's a teapot!" and not "He might be a teapot, or he might be chiding me for misusing llms or he might be signaling that the monkey is out of bananas or [...]"
I agree, though that means I really should stop returning my 404 - Server Unavailable response, but you'll never have my 500 - OK.
What would be an appropriate response code for "He might be a teapot, or he might be chiding me for misusing llms or he might be signaling that the monkey is out of bananas or [...]"?
I think it's a good representation of a hallucination.
(on that note, I'm putting the kettle on :)