Skip to content

Fix #110: vLLM hf_token, tokenizer trust_remote_code, LoRA/kwargs fixes - #119

Open
anush-933 wants to merge 3 commits into
LLMSQL:mainfrom
anush-933:fix/issue-110-vllm-tokenizer-kwargs-lora
Open

anush-933 wants to merge 3 commits into
LLMSQL:mainfrom
anush-933:fix/issue-110-vllm-tokenizer-kwargs-lora

Conversation

@anush-933

@anush-933 anush-933 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #110

  • vLLM: pass hf_token as hf_token to vLLM(); clarify docstrings
  • Transformers: use function's trust_remote_code when loading tokenizer
  • vLLM inference: keep LoRA validation checks intact
  • CLI (vLLM): add LoRA flags (--enable-lora, --lora-path, --lora-name, --lora-scale, --lora-config) and pass lora_config
  • Remove template files (.github/*) which belong to Add PR template and feature request issue template #118
  • Rebased on main

@DzmitryPihulski DzmitryPihulski left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @anush-933, thank you for your contribution! The tokenizer trust_remote_code fix and the docstring/README corrections are exactly what #110 asked for. A few things need changing before we can merge:

  1. Wrong argument name for the token. vllm.LLM() takes hf_token, not token. With token= the engine will either raise TypeError: unexpected keyword argument or ignore it, so gated models still won't load. Please pass llm_init_args["hf_token"] = hf_token.
  2. Keep the LoRA consistency check. #110 asked to deduplicate the enable_lora validation, not remove it. Right now the second check (lora_config given but enable_lora not set) is deleted, so --lora-path without --enable-lora silently does nothing. Either keep one copy of each check, or (nicer) make --lora-path / --lora-config imply enable_lora=True in the CLI.
  3. Tests. #110 asks for a test for each fix. Mocked tests are fine (no GPU needed); see mock_llm in tests/inference/conftest.py and tests/cli/test_model_args.py for the pattern:
    • hf_token reaches LLM(...) as hf_token;
    • the tokenizer gets trust_remote_code=False when the argument is False;
    • tokenizer_kwargs / llm_kwargs override the explicit parameters (the documented precedence);
    • --lora-path from the CLI produces the expected lora_config and enables LoRA.
  4. Remove the template files (.github/pull_request_template.md, .github/ISSUE_TEMPLATE/feature_request.yml); they belong to #118.
  5. Please rebase on current main; #113 and #121 just changed the test setup so the suite runs without vLLM installed.

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

@anush-933
anush-933 force-pushed the fix/issue-110-vllm-tokenizer-kwargs-lora branch from 6af6801 to 2db7958 Compare October 6, 2026 04:22

@DzmitryPihulski DzmitryPihulski left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @anush-933, thank you for the quick update! hf_token is now passed correctly, the template files are gone, and you're right that the removed LoRA check was an exact duplicate of the one above it, so --lora-path without --enable-lora still gives a clear error. Nice.

Two things left before we merge:

  1. Tests (point 3 of the previous review). Mocked tests are enough, no GPU needed; see mock_llm in tests/inference/conftest.py and tests/cli/test_model_args.py for the pattern:
    • hf_token reaches LLM(...) as hf_token;
    • the tokenizer gets trust_remote_code=False when the argument is False;
    • tokenizer_kwargs / llm_kwargs override the explicit parameters (the documented precedence);
    • --lora-path from the CLI produces the expected lora_config.
  2. Please run ruff format llmsql/_cli/inference.py: the new LoRA add_argument lines are over the line length.

Note that #129 was just merged and also touches llmsql/_cli/inference.py; it merges cleanly with your branch, but please update from main before pushing.

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

@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

anush-933 added 3 commits October 10, 2026 20:42
@anush-933
anush-933 force-pushed the fix/issue-110-vllm-tokenizer-kwargs-lora branch from 2db7958 to dc4ff94 Compare October 10, 2026 15:19
@anush-933

Copy link
Copy Markdown
Contributor Author

Thanks for the review! Pushed the remaining items and rebased on the latest main:

  • Added mocked tests (no GPU needed):
    • ests/inference/test_inference_vllm_args.py: \hf_token\ reaches \LLM(...)\ as \hf_token\, and \llm_kwargs\ override the explicit params.
      
    • ests/inference/test_inference_transformers_tokenizer.py: tokenizer gets \	rust_remote_code=False\ when the argument is False, and \	okenizer_kwargs\ override the explicit params.
      
    • \ ests/cli/test_model_args.py: --lora-path\ produces the expected \lora_config.
  • Ran
    uff format llmsql/_cli/inference.py.
  • Made --lora-path\ / --lora-config\ imply \enable_lora=True, so you no longer need --enable-lora\ on top.
  • Rebased on main (templates now come from Add PR template and feature request issue template #118, so they're no longer in this PR's diff).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] vLLM backend ignores hf_token, tokenizer ignores trust_remote_code, and kwargs precedence is documented backwards

2 participants