PQS: Score & Optimize LLM Prompts for Quality Inference