llmsql-benchmark icon indicating copy to clipboard operation
llmsql-benchmark copied to clipboard

[Inference] Unsafe transformers defaults: `dtype=float16` and `trust_remote_code=True`

Open DzmitryPihulski opened this issue 1 month ago • 2 comments

Problem

inference_transformers() has two risky defaults:

  1. dtype=torch.float16. Many current models are trained and shipped in bfloat16; running them in float16 can overflow and produce NaNs or garbage text without any error, which silently lowers the measured accuracy.
  2. trust_remote_code=True for the model. This executes arbitrary code from the model repo by default. inference_vllm already defaults to False. (#110 covers the tokenizer ignoring the argument; this issue is about the default itself.)

Proposal

  • Default dtype="auto" (use the dtype from the model config); keep accepting explicit values. Same default in the CLI.
  • Default trust_remote_code=False for both model and tokenizer, matching vLLM; mention in the docs/CHANGELOG that models with custom code need --trust-remote-code.

DzmitryPihulski avatar Oct 05 '26 16:10 DzmitryPihulski

Hi @DzmitryPihulski , I’d like to work on this issue. Would it be okay if I picked it up?

Thanks!

satheesh142002 avatar Oct 06 '26 05:10 satheesh142002

@satheesh142002 of cource, go ahead!

If you find LLMSQL useful, we'd be grateful if you could give the project a ⭐ on GitHub, it really helps us!

DzmitryPihulski avatar Oct 06 '26 07:10 DzmitryPihulski