-
Notifications
You must be signed in to change notification settings - Fork 38
Fix: Address context-guru plugin review feedback (#660) #672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,10 @@ | ||
| //go:build !exclude_plugin_contextguru | ||
| //go:build include_plugin_contextguru | ||
|
|
||
| // context-guru is opt-IN (positive build tag), unlike the other plugins which are | ||
| // compiled in by default and dropped via exclude_plugin_*. Its embedded engine | ||
| // pulls a large transitive set (bifrost/core, tiktoken-go, tree-sitter grammars, | ||
| // starlark), so it is kept out of the default authbridge-proxy/-envoy binaries and | ||
| // linked only when built with -tags include_plugin_contextguru. | ||
| package main | ||
|
|
||
| import _ "github.com/kagenti/kagenti-extensions/authbridge/authlib/plugins/contextguru" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,10 @@ | ||
| //go:build !exclude_plugin_contextguru | ||
| //go:build include_plugin_contextguru | ||
|
|
||
| // context-guru is opt-IN (positive build tag), unlike the other plugins which are | ||
| // compiled in by default and dropped via exclude_plugin_*. Its embedded engine | ||
| // pulls a large transitive set (bifrost/core, tiktoken-go, tree-sitter grammars, | ||
| // starlark), so it is kept out of the default authbridge-proxy/-envoy binaries and | ||
| // linked only when built with -tags include_plugin_contextguru. | ||
| package main | ||
|
|
||
| import _ "github.com/kagenti/kagenti-extensions/authbridge/authlib/plugins/contextguru" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,19 +91,34 @@ And the observed answers: | |
| ## Run it | ||
|
|
||
| ```bash | ||
| export CG_MODEL_KEY=<api key for the extract-code model> # e.g. an OpenAI-compatible key | ||
| export CG_MODEL_KEY=<api key for the extract-code model> # e.g. an OpenAI-compatible key | ||
| export CG_MODEL_BASE=https://api.openai.com # any OpenAI-wire endpoint | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit (optional): the Run it block exports |
||
| ./run.sh all # setup + drive off, observe, enforce and print the comparison | ||
| # or step by step: | ||
| ./run.sh setup | ||
| ./run.sh drive enforce # (or observe / off) | ||
| ``` | ||
|
|
||
| `run.sh setup` builds the `authbridge-proxy` image **with the context-guru plugin**, | ||
| loads it + the enhanced `finance-mcp` into the `kagenti` kind cluster, creates a | ||
| 12,288-token-window Ollama model (`llama3.2-ctx12k`) so the raw request truncates, | ||
| and deploys the agent + sidecar. `run.sh drive <mode>` flips `on_error`, restarts, | ||
| drives the audit, and prints the agent's answer + the byte/token gain from the | ||
| sidecar session API (`:9094`). | ||
| `run.sh setup` builds the `authbridge-proxy` image **with the context-guru plugin** | ||
| (`-tags include_plugin_contextguru` — see *Build integration* below), loads it + the | ||
| enhanced `finance-mcp` into the `kagenti` kind cluster, creates a 12,288-token-window | ||
| Ollama model (`llama3.2-ctx12k`) so the raw request truncates, and deploys the agent | ||
| + sidecar. `run.sh drive <mode>` flips `on_error`, restarts, drives the audit, and | ||
| prints the agent's answer + the byte/token gain from the sidecar session API (`:9094`). | ||
|
|
||
| ## Build integration | ||
|
|
||
| context-guru is **opt-in**: unlike the other plugins (compiled in by default, | ||
| dropped via `-tags exclude_plugin_*`), it is linked only when the binary is built | ||
| with `-tags include_plugin_contextguru`. Its embedded engine pulls a large | ||
| transitive dependency set (bifrost/core, tiktoken-go, tree-sitter grammars, | ||
| starlark), so the default `authbridge-proxy`/`authbridge-envoy` binaries stay lean | ||
| and a deployment that doesn't want compaction never pays for it. | ||
|
|
||
| ```bash | ||
| cd authbridge && podman build -f cmd/authbridge-proxy/Dockerfile \ | ||
| --build-arg GO_BUILD_TAGS=include_plugin_contextguru -t authbridge-cg:latest . | ||
| ``` | ||
|
|
||
| ## Configuration reference | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.