openfreerouter/freerouter ? reverse-engineered prompt
Reverse engineered prompt
Build me a self hosted AI model router that I can run locally and point my apps at instead of OpenRouter.
I want one OpenAI compatible endpoint that takes chat requests, automatically picks the best model for the message, and forwards it using my own API keys so there is no markup. It should be smart enough to send simple requests to a cheaper model and more complex ones to a stronger model, with an easy way to force a choice when I know better, like simple, complex, or reasoning. It should also handle timeouts and fall back to another model if one provider is slow.
Please include a config file I can edit without rebuilding, plus a way to reload the config while the server is running. Add a health check, stats, and a models endpoint, and make sure it works with common OpenAI style clients and tool calls. If you need to check current docs for provider APIs, go ahead and look them up online.
Are you gonna build this?
make sure you review the code using coderabbit