mirror of
https://github.com/mudler/LocalAI.git
synced 2026-07-31 02:18:50 -04:00
fix(vllm): apply Options[] engine flags before engine init (#11130) CLI-style flags in a model's `options:` array (`--quantization:gptq_marlin`, `--enable-prefix-caching`, `--kv-cache-dtype:fp8_e5m2`) were discarded: the backend only ever read `tool_parser`/`reasoning_parser` out of Options[], and did so *after* `AsyncLLMEngine.from_engine_args()`, where nothing it set could still reach the engine. Map `--` prefixed options onto the AsyncEngineArgs dataclass before the engine is constructed. Names are normalized the way vLLM's CLI spells them (`--enable-prefix-caching` -> `enable_prefix_caching`), values are coerced to the target field's type (bare flag -> True for booleans), and unknown or uncoercible flags warn and are skipped instead of failing the load, since Options[] is a bag shared with backend-level settings. Field types come from the annotation's base so `Literal["auto", "float16"]` (vLLM's dtype) is not mistaken for a float. Precedence is typed proto fields -> `options:` -> `engine_args:`. The production engine_args defaults seeded in hooks_vllm.go therefore skip any key the user already set as an option, otherwise the later engine_args pass would silently override it. Parser lookups now accept both spellings, so `--reasoning-parser:qwen3` selects LocalAI's parser as well. The helper's tests are stdlib-only and run in the lint workflow's dependency-light job via `make test-python-helpers`. Assisted-by: Claude:claude-opus-5 golangci-lint Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: localai-org-maint-bot <bot-opensource@localaisrl.com>
78 lines
2.8 KiB
YAML
78 lines
2.8 KiB
YAML
---
|
|
name: 'lint'
|
|
|
|
on:
|
|
pull_request:
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
- 'examples/**'
|
|
- 'README.md'
|
|
- '**/*.md'
|
|
# golangci-lint runs new-from-merge-base, so a diff with no touched Go
|
|
# lines can only ever be a no-op. See .agents/ci-caching.md.
|
|
- 'gallery/**'
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
concurrency:
|
|
group: ci-lint-${{ github.event.pull_request.number || github.sha }}-${{ github.repository }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
jobs:
|
|
golangci-lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
# Full history so golangci-lint's new-from-merge-base can reach
|
|
# origin/master and compute the diff against it.
|
|
fetch-depth: 0
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.26.x'
|
|
cache: false
|
|
- name: install golangci-lint
|
|
run: |
|
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
|
|
| sh -s -- -b "$(go env GOPATH)/bin" v2.11.4
|
|
- name: generate grpc proto sources
|
|
# pkg/grpc/proto/*.go is generated, not checked in. Several packages
|
|
# import it, so without this step typecheck fails project-wide.
|
|
run: make protogen-go
|
|
- name: stub react-ui dist for go:embed
|
|
# core/http/app.go has //go:embed react-ui/dist/*; the glob needs at
|
|
# least one non-hidden entry to satisfy typecheck. We don't run
|
|
# `make react-ui` here because lint doesn't need the real bundle.
|
|
run: |
|
|
mkdir -p core/http/react-ui/dist
|
|
touch core/http/react-ui/dist/index.html
|
|
- name: lint
|
|
run: make lint
|
|
|
|
build-scripts:
|
|
# The image packaging scripts encode invariants that only surface inside a
|
|
# container build (a missing transitive dep, a partial cuDNN family). Their
|
|
# shell tests need nothing but bash + gcc + ldd, so run them on every PR
|
|
# rather than waiting on a multi-GB cross-arch backend image build.
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: run packaging script tests
|
|
run: make test-build-scripts
|
|
|
|
# The backend matrix path filter fails silently: a miss emits an empty
|
|
# matrix, every job goes green, and the change reaches no image (#10946).
|
|
# Its tests need only node, so they ride along with this job.
|
|
- uses: actions/setup-node@v7
|
|
with:
|
|
node-version: '20'
|
|
- name: run CI script tests
|
|
run: make test-ci-scripts
|
|
|
|
# The shared python backend helpers (Options[] parsing, engine-arg
|
|
# mapping, model reference resolution) are stdlib-only, so their tests
|
|
# ride along here instead of waiting on a multi-GB backend image build.
|
|
- name: run shared python backend helper tests
|
|
run: make test-python-helpers
|