While conventional image compression techniques are optimized for human visual perception, the rise of machine learning techniques has led to the emergence of image compression methods tailored for machine vision tasks. Although a few recent studies explored target-dependent reconfiguration of lightweight codecs such as JPEG, these approaches are limited to specific trained bitrates only. Moreover, existing deep learning-based compression frameworks entail a high computational cost, making them impractical for real-time compression on devices with limited resources. In this paper, we present a novel JPEG compression framework that can adaptively generate an optimal quantization table (QT) depending on both the target bitrate and the target metric (quality or accuracy). To provide fine controllability over a wide range of bitrates, we employ a feature modulation technique to a QT generator and bitrate predictor, which are trained by a novel training method called bitrate range partitioning. Our simulation results show that the proposed framework enhances the performance of standard JPEG by up to 2dB in PSNR and 10% in accuracy at the same bitrate, while incurring minimal computational overhead compared to JPEG.