Repository navigation
hive/dwarfstar: its models reach for tools, held to ds4's own templates - #110
Merged
Merged
Conversation
The bee hands a prompt's tools to its model in the model family's own template (DeepSeek V4 and V4.1 DSML, GLM, Qwen), ported from ds4's server into src/chat.c, reads the calls the model writes back out, and reaches them as tendrils through humd. A bloom waiting on its grasps parks so the engine serves the queue meanwhile, and lets go after DWARFSTAR_REACH_MS. make test checks the templates and readers anywhere; make conform compiles ds4's own server code beside the port and holds them byte for byte. ds4's MIT notice travels with the port in LICENSE-ds4. The bee reports the release version and release.sh bumps it. Prose leaves dwarfstar's code files for its README.
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.
dwarfstar's bees dropped every prompt's
tools, so its models said they had none. That included thewreplhumd hands every bloom from web2. Now they reach.Tendrils. A prompt's tools go to the model in its family's own template: DSML for DeepSeek V4 and V4.1,
<tool_call>with<arg_key>/<arg_value>for GLM, and<tool_call>with<function=…>for Qwen. The bee asks the engine which family it loaded. ds4 keeps all of this private tods4_server.c, sosrc/chat.cports it: the templates, the tool preambles, and the readers of the calls a model writes. A bloom grows in rounds:tendrilpetal and goes out astendril-reach.tendril-resultis told to the forager astendril-info, and once every reach has come back the next round grows.The model's own calls are rendered exactly as it sampled them, so the KV cache still holds them. A prompt whose graft ends in grasps now grows on, where it used to be refused with
cannot-grow-on. Blooms without tools encode exactly as before. The hello declares the tendril chis, and richness goes fromleantomedium.Parking. ds4 runs one engine per bee. While a bloom waits on its grasps it parks, and the engine serves the rest of the queue, so a client that takes a tool call and never answers holds nothing up. A parked bloom lets go after
DWARFSTAR_REACH_MS(30 min, the same as the forager's hold) withtendril_unanswered, or when a cancel or a new prompt arrives on its sid.Held to ds4.
make testchecks the templates and readers on any machine (15 cases).make conformcompiles ds4's own server code in its test mode, as ds4'sds4_testdoes, beside the port. It requires the same prompts byte for byte across 6 conversations × 4 families, with and without tools, and the same calls read from sample outputs: 54 of 54. A copy ofchat.cwith one byte changed in a template and one in the DSML reader fails 13 of them, so it is the check to run whenDS4_SHAmoves. The two deliberate departures are left out of it:Licence. The port lives in this repo rather than in gitignored
vendor/, so ds4's MIT notice is kept beside it inLICENSE-ds4, and the README says what it covers.Version. The bee reported a hardcoded
0.33.1. It reports0.35.1now, andrelease.shbumps the#define VERSIONinsrc/main.cwith the other hives. A dry run of the sed and of the drift check both pass.Code is speech. Prose leaves dwarfstar's code files (sources,
Makefile,Orchfile,build,install) and goes to its README, which now describes the tendril rounds, the parking,DWARFSTAR_REACH_MS, the build targets, and the shader overrides the stripped comments explained.Verified. Everything builds with no warnings under
-Wall -Wextra -Wpedantic -Wshadow.The stub bee, through the openai-server forager on a live humd:
tool_callscame back, then the answer.wreplreach served by web2 inside one bloom.The real DeepSeek V4 Flash Q2, run as a separate test bee sharing the hive's GPU lock:
get_weather {"city":"Oslo"}and answered from the result. The second round took 1.8 s, so the cache held.wreplthrough several rounds and listed web2's weather service correctly.invoke, the template's own tag word: 11 of 16 calls in one run, almost all on one phrasing of the prompt. The bee passes that name through as written, and humd answers it as unserved.Not read yet: a forced reach (
tendrils.reachofrequiredor a tool's name) andtendrils.parallel. Vision and thinking stay off.