Repository navigation
feat(strata): run Tencent Hy4-Flash on the strata-hy4 engine - #13389
Merged
Merged
Conversation
Hy4-Flash does not run on the engine that serves the Qwen models. Strata ships a separate program, strata-hy4, that speaks the same --serve line protocol with its own short list of flags. Add a hy4 family to the strata backend: - family:hy4 reads a .strata build file, the shared Engram file and an optional vision file, and starts the engine with --native, --engram, --max-context and, when `--info` says the engine has them, --vision and --draft dfly2 (speculative decoding). - The tokenizer and chat template are read from the build file and converted with Strata's own tool on the first load. - Pictures are files named by image= keys on the GEN line; the helper uses Strata's parser for Hy4's tagged reasoning and tool-call tokens. - The image carries the Hy4 engine packages in engines-hy4/, pinned one by one with their own tag, version and SHA-256. The launcher picks them when STRATA_ENGINE_FAMILY=hy4. The bump script and the pins test read both families. - Add three gallery entries (SQ-64, SQ-96, SQ-128) pinned to a Hugging Face commit, and the docs. The Qwen path is unchanged. Assisted-by: Claude:claude-sonnet-5-5 Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Assisted-by: Claude:claude-sonnet-5-5 Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes the experimental
stratabackend run Tencent Hy4-Flash. Strata v0.2.18 ships it as a separate engine program,strata-hy4, plus Hugging Face repositorystrata-engine/Hy4-Flash-Strata. This adds ahy4family to the backend, the engine packages to the image, and three gallery entries (SQ-64, SQ-96, SQ-128).Draft: not run on real hardware. No machine available to me had both the memory and a fast drive for the model (at least 64 GiB of RAM, a GPU, about 130 GB of fast disk) and was free to use. Nothing here has loaded the real model. See "Not verified".
How
strata-hy4works (read from the Strata sources at v0.2.18)--serveline protocol as the other engine (READY,GEN,T,DONE,STOP,QUIT), but a short flag list and a strict parser: an unknown flag orGENkey is an error. So none of the Qwen flags are sent.--native <build> --engram <file> --max-context N [--vision <file>] [--vram-experts-gb X] [--ram-experts-gb Y] [--draft dfly2]. There is no pack directory.strata-hy4 --info <build>printsarch=hy4flash ... drafter=dfly2 images=1. Strata's own server asks for the drafter and the vision file only when the engine says it has them; the backend does the same..stratafile (a zstd JSON manifest at the end). Strata'stools/hy4_tokenizer.pyturns it into the tokenizer directory.image=<path>key per picture on theGENline, one image placeholder per picture in the prompt, expanded by the engine. No encoder program, noGENI.<think:opensource>,<tool_calls:opensource>, ...). Strata translates them withserve/hy4_dialect.pyand usesHy4OutputParser; the template takesreasoning_effortofno_think,highormax.Changes
backend/go/strata:family:hy4(newhy4.go). Options:native,engram,vision,drafter,vram_experts_gb,ram_experts_gb. Reads Section 0 in Go (zstd), runs the Strata tool to make the tokenizer directory next to the build file (staged and renamed, stamped with the file name and size), probes--info, writes pictures to scratch files, stops on<hy_end>and<hy_EOT>. The helper uses Hy4's parser, effort words and literal tags for this family only. The Qwen path is unchanged.engines-hy4/in the image, filled bymake enginefromstrata-hy4-<version>-<target>.tar.gzpackages, each pinned with its own tag, version and SHA-256 (STRATA_HY4_*).strata-enginepicks them withSTRATA_ENGINE_FAMILY=hy4..github/bump_strata.shandscripts/build/strata-pins_test.shread both families. The Python sources fetched at the pinned commit addhy4_tokenizer.py,hy4_dialect.pyandtoolformat.py. The image grows by the Hy4 engine packages (same targets as the existing engines).hy4-flash-sq-64-strata,-96-,-128-, pinned to Hugging Face commit995bac227ab7e0d221772be641e2b5954a9fac06, with the SHA-256 values of the build, Engram and vision files (checked against the Hugging Face API). The three entries share one model directory, so the 67.6 GB Engram file is downloaded once. Licence keytencent-hy-license(Tencent Hy License 1.0, Apache-derived with extra terms for very large MaaS businesses), named in the description.core/gallery/strata_entries_test.gocovers the new family and licence; the Qwen checks are unchanged.docs/content/models/engines/strata.md(hardware, models table, options) and the backend README. The memory and disk figures are the vendor's, marked as such.Checks run
go vet,golangci-lintand the backend unit tests (new tests cover option parsing, the start line,--info, Section 0 reading, the tokenizer stamp, picture keys, EOS and logprobs refusal against the stub engine).go test ./core/gallery/,scripts/build/strata-pins_test.sh,make check-pins.Hy4-Flash-SQ-64.strata(read by range request): tokenizer conversion, prompt rendering with and without thinking, image placeholders, quoted tag kept as text, and a streamed reply with reasoning and a tool call parsed into events.make engine-packages-hy4fetched and checksum-verified the real x86_64 CUDA 12 package; the launcher ran it (strata-hy4 0.1.64).bump_strata.shagainst the live release rewrote a deliberately wrong pin back to the pinned value, so all nine Hy4 SHA-256 pins match the release'sSHA256SUMS.txtand GitHub's digests.Not verified
--info, the--servestart with these flags, DFly2, images, memory placement and speed are untested here.vram_experts_gbandram_experts_gb; Strata's launcher computes them, this backend only passes them through and sets none by default. Unified-memory machines are the case Strata documents without them.🤖 Generated with Claude Code