Repository navigation
Add magpie-model-watch: gateway hook reporting model calls to a local collector - #1192
Open
cpufreestyle wants to merge 1 commit into
Open
cpufreestyle wants to merge 1 commit into
cpufreestyle wants to merge 1 commit into
Conversation
Contributor
|
Thanks. I read
Smaller: The registry entry itself (external package, |
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
magpie-model-watch— a gateway hook that reports each real model call to a collector you run locally: the model, the HTTP status and the latency. A dashboard then shows which models actually answered and how fast, without sending test requests of its own.Prompt, replies and keys stay put: only the model name, status and timing leave the hook, and every send is a best-effort, fire-and-forget POST that never blocks or fails a request.
Why it is not in
packages/Maintained in its own repository, like
magpie-search-mix,@guotree/magpie-websearchand@openviking/magpie-plugin: https://github.com/cpufreestyle/magpie-model-watchmagpie-model-watch(0.1.0, MIT)"magpie": { "hooks": "./model-watch.hooks.js", "options": { "bridgeUrl": "http://127.0.0.1:8787", "sampleEvery": 1, "maxPerMinute": 120 } }onRequest(body, ctx)(keeps the model asked for) andonResponse(reply, ctx)(status and latency), plusonEventfor quota/error noticesnode --test) covering the report shape, throttling, the off-switch and a collector that is not listeningNote on the collector
The hook needs a collector to be useful; with none listening it does nothing (the POST fails quietly, nothing is retried or logged). Any HTTP endpoint accepting
POST /probe/reportwith{"model","status","latencyMs","source":"hook"}works, so it is not tied to my own dashboard. That is stated in the package README and in the registry summary.Checks
node --input-type=module -e 'registryProblems(...)'on the changedregistry.json: 0 problemsnode --testin the package: 5 pass