Adaptive Classification for LLM Optimization and Routing