Directories
ΒΆ
| Path | Synopsis |
|---|---|
|
Package accwire reads a request body for the accountant, one adapter per wire.
|
Package accwire reads a request body for the accountant, one adapter per wire. |
|
adapters
|
|
|
bifrost
Package bifrost adapts context-guru's pipeline to bifrost's LLMPlugin interface: our components run as a pre-LLM-call hook (design D2).
|
Package bifrost adapts context-guru's pipeline to bifrost's LLMPlugin interface: our components run as a pre-LLM-call hook (design D2). |
|
Package adjudicate declares the context-maintenance tool the cold-sweep adjudication asks with, and the wire helpers that keep it byte-stable in the prompt-cache prefix.
|
Package adjudicate declares the context-maintenance tool the cold-sweep adjudication asks with, and the wire helpers that keep it byte-stable in the prompt-cache prefix. |
|
Package agent is the extension point for a client agent (an IDE, a CLI) that talks to a host in its own way.
|
Package agent is the extension point for a client agent (an IDE, a CLI) that talks to a host in its own way. |
|
all
Package all blank-imports every built-in agent so their init() registrations run.
|
Package all blank-imports every built-in agent so their init() registrations run. |
|
bob
Package bob is the agent for IBM Bob: the Bob IDE and Bob Shell.
|
Package bob is the agent for IBM Bob: the Bob IDE and Bob Shell. |
|
claudecode
Package claudecode holds Claude Code's header rules.
|
Package claudecode holds Claude Code's header rules. |
|
codex
Package codex reads the ids OpenAI Codex (the CLI, the exec mode, the IDE extension and the apps built on its app server) puts in its request headers.
|
Package codex reads the ids OpenAI Codex (the CLI, the exec mode, the IDE extension and the apps built on its app server) puts in its request headers. |
|
opencode
Package opencode holds OpenCode's header rules.
|
Package opencode holds OpenCode's header rules. |
|
pi
Package pi holds Pi's mark.
|
Package pi holds Pi's mark. |
|
Package apply is the one place the pipeline meets a raw wire request, shared by every host adapter (the bifrost proxy and an in-process sidecar plugin).
|
Package apply is the one place the pipeline meets a raw wire request, shared by every host adapter (the bifrost proxy and an in-process sidecar plugin). |
|
Package campaign holds the keep-alive campaign math that every host shares: the closed-form replay of a ping plan, the calibrated constants, the fidelity model behind the adapt report, the ship gate, the auto builder's spec, and the mapping of a suggest arm to a live strategy.
|
Package campaign holds the keep-alive campaign math that every host shares: the closed-form replay of a ping plan, the calibrated constants, the fidelity model behind the adapt report, the ship gate, the auto builder's spec, and the mapping of a suggest arm to a live strategy. |
|
Package cheapmodel provides a minimal Anthropic Messages client used as the engine's injected extraction model.
|
Package cheapmodel provides a minimal Anthropic Messages client used as the engine's injected extraction model. |
|
cmd
|
|
|
cg-backfill-project
command
Command cg-backfill-project fills the project column on requests recorded before that column existed, reading each session's working directory out of the agent's own transcripts.
|
Command cg-backfill-project fills the project column on requests recorded before that column existed, reading each session's working directory out of the agent's own transcripts. |
|
cg-cache-campaign
command
cg-cache-campaign reads a dashboard database READ-ONLY and writes two files:
|
cg-cache-campaign reads a dashboard database READ-ONLY and writes two files: |
|
cg-selarm
command
cg-selarm runs one adjudication ARM against the rebuilt selection corpus and writes its decisions.
|
cg-selarm runs one adjudication ARM against the rebuilt selection corpus and writes its decisions. |
|
cg-transcript-replay
command
cg-transcript-replay runs the shipped pipeline over request sequences rebuilt from Claude Code transcripts (scripts/analysis/cc_transcript_requests.py) and writes, per call, what the pipeline changed.
|
cg-transcript-replay runs the shipped pipeline over request sequences rebuilt from Claude Code transcripts (scripts/analysis/cc_transcript_requests.py) and writes, per call, what the pipeline changed. |
|
context-guru-proxy
command
Command context-guru-proxy is the LLM proxy integration and the eval-containers gateway.
|
Command context-guru-proxy is the LLM proxy integration and the eval-containers gateway. |
|
gen-datadep
command
Command gen-datadep writes docs/data-dependence.md from the row files under docs/data-dependence/ and the template page.md.tmpl there.
|
Command gen-datadep writes docs/data-dependence.md from the row files under docs/data-dependence/ and the template page.md.tmpl there. |
|
Package compactionpoint answers ONE question: at what provider-billed input does a conversation's own compaction mechanism act?
|
Package compactionpoint answers ONE question: at what provider-billed input does a conversation's own compaction mechanism act? |
|
Package components defines context-guru's component model: the abstract API every context-engineering operation implements, the per-component report used for metrics, the runtime context handed to each component, and the pipeline that stacks them in configured order.
|
Package components defines context-guru's component model: the abstract API every context-engineering operation implements, the per-component report used for metrics, the runtime context handed to each component, and the pipeline that stacks them in configured order. |
|
all
Package all blank-imports every built-in component so their init() registrations run.
|
Package all blank-imports every built-in component so their init() registrations run. |
|
dsl
Package dsl is a declarative, user-extensible text-filter engine, adapted from rtk's TOML filter DSL (design D11).
|
Package dsl is a declarative, user-extensible text-filter engine, adapted from rtk's TOML filter DSL (design D11). |
|
offload
Package offload holds the lossy-but-reversible components (they drop bytes and stash the original for the expand tool loop).
|
Package offload holds the lossy-but-reversible components (they drop bytes and stash the original for the expand tool loop). |
|
reformat
Package reformat holds the lossless components (they repack the request denser or add caching hints without losing information).
|
Package reformat holds the lossless components (they repack the request denser or add caching hints without losing information). |
|
Package config loads context-guru's configuration and builds a pipeline from it.
|
Package config loads context-guru's configuration and builds a pipeline from it. |
|
Package dash is context-guru's persistent observability layer: the durable per-request store behind the dashboard, the off-hot-path capture pipeline that fills it, the JSON/SSE API the UI reads, and the embedded single-file UI.
|
Package dash is context-guru's persistent observability layer: the durable per-request store behind the dashboard, the off-hot-path capture pipeline that fills it, the JSON/SSE API the UI reads, and the embedded single-file UI. |
|
Package dispatch is the one way a context-guru core package reaches an external service.
|
Package dispatch is the one way a context-guru core package reaches an external service. |
|
dispatchtest
Package dispatchtest holds what every host of dispatch.Dispatcher tests against: the exported contract (Contract), a recording fake for core tests (Fake), and a minimal HTTP host for tests that talk to an httptest server (HTTPHost).
|
Package dispatchtest holds what every host of dispatch.Dispatcher tests against: the exported contract (Contract), a recording fake for core tests (Fake), and a minimal HTTP host for tests that talk to an httptest server (HTTPHost). |
|
examples
|
|
|
llm-d-service/client
command
Command client is a minimal, dependency-free example of calling the context-guru compaction service the way the llm-d-router request-inline-compaction step does: POST the inference request body to the service and, on a 200 with a non-empty JSON object, use the returned (smaller) body in place of the original.
|
Command client is a minimal, dependency-free example of calling the context-guru compaction service the way the llm-d-router request-inline-compaction step does: POST the inference request body to the service and, on a 200 with a non-empty JSON object, use the returned (smaller) body in place of the original. |
|
Package expand holds the host-agnostic half of reversibility (design D6, after headroom's CCR): the marker format Offload components write, the expand(id) tool definition injected per provider, and resolution of a stashed original from the Store.
|
Package expand holds the host-agnostic half of reversibility (design D6, after headroom's CCR): the marker format Offload components write, the expand(id) tool definition injected per provider, and resolution of a stashed original from the Store. |
|
Package inband is the in-band loop: the host answers a call to one of our own tools (expand, adjudicate, tool search) itself, so the client never sees the call.
|
Package inband is the in-band loop: the host answers a call to one of our own tools (expand, adjudicate, tool search) itself, so the client never sees the call. |
|
internal
|
|
|
buildinfo
Package buildinfo exposes version metadata stamped at build time via -ldflags.
|
Package buildinfo exposes version metadata stamped at build time via -ldflags. |
|
coref
Package coref builds the Tier-1 co-reference index that co-reference-aware compaction decides from: for each tool output in a request, which identifiers that output INTRODUCED, and whether any later turn carried them forward.
|
Package coref builds the Tier-1 co-reference index that co-reference-aware compaction decides from: for each tool output in a request, which identifiers that output INTRODUCED, and whether any later turn carried them forward. |
|
datadep
Package datadep builds docs/data-dependence.md from one file per table row.
|
Package datadep builds docs/data-dependence.md from one file per table row. |
|
deferred
Package deferred knows the format of Claude Code's deferred-tools list.
|
Package deferred knows the format of Claude Code's deferred-tools list. |
|
extract
Package extract is the cheap-model tool-output extractor.
|
Package extract is the cheap-model tool-output extractor. |
|
inbandtest
Package inbandtest holds the stream-chunk builders that tests of the in-band splicers share (inband's own tests and a host's end-to-end tests).
|
Package inbandtest holds the stream-chunk builders that tests of the in-band splicers share (inband's own tests and a host's end-to-end tests). |
|
logging
Package logging is context-guru's logging plumbing: the level/format/sink decision, the credential scrubber that sits in front of every handler, and the per-request logger that carries tenant and session onto the lines of one request's lifecycle β including the ones written after the response, off the request path (see With, and the boundary named there).
|
Package logging is context-guru's logging plumbing: the level/format/sink decision, the credential scrubber that sits in front of every handler, and the per-request logger that carries tenant and session onto the lines of one request's lifecycle β including the ones written after the response, off the request path (see With, and the boundary named there). |
|
modelinfo
Package modelinfo resolves a model's context window (max input tokens) and per-token price, so context-guru's triggers can scale with the model rather than hard-coding thresholds.
|
Package modelinfo resolves a model's context window (max input tokens) and per-token price, so context-guru's triggers can scale with the model rather than hard-coding thresholds. |
|
modelinfo/litellm
Package litellm fetches and caches the LiteLLM community price/window map (model_prices_and_context_window.json) and prices the operator's own gateway rate card from it.
|
Package litellm fetches and caches the LiteLLM community price/window map (model_prices_and_context_window.json) and prices the operator's own gateway rate card from it. |
|
modelinfo/ratefilltest
Package ratefilltest holds what the per-caller price fixture tests share (issue #856): the model list and the check against testdata/ratefill_before.json.
|
Package ratefilltest holds what the per-caller price fixture tests share (issue #856): the model list and the check against testdata/ratefill_before.json. |
|
record
Package record turns one proxied call into the forms the recorder writes.
|
Package record turns one proxied call into the forms the recorder writes. |
|
redact
Package redact holds the credential-scrubbing primitives: the patterns that recognise a credential in arbitrary text, and the key-name test that recognises one by the name it is stored under.
|
Package redact holds the credential-scrubbing primitives: the patterns that recognise a credential in arbitrary text, and the key-name test that recognises one by the name it is stored under. |
|
skills
Package skills parses Claude Code's skills listing β the prose block that declares which skills a request carries.
|
Package skills parses Claude Code's skills listing β the prose block that declares which skills a request carries. |
|
testutil
Package testutil holds helpers for tests that wait for something asynchronous.
|
Package testutil holds helpers for tests that wait for something asynchronous. |
|
testutil/testdb
Package testdb opens SQLite files for tests the way production does.
|
Package testdb opens SQLite files for tests the way production does. |
|
tokens
Package tokens estimates token counts using a real BPE tokenizer (o200k_base, the modern GPT family encoding) β an accurate offline proxy.
|
Package tokens estimates token counts using a real BPE tokenizer (o200k_base, the modern GPT family encoding) β an accurate offline proxy. |
|
treesitter
This file is the pure-Go face of the treesitter package: when the cg_skeleton tag is absent, the real cgo implementation (treesitter.go) is excluded and this empty package takes its place, so `go build ./...` under CGO_ENABLED=0 links no tree-sitter grammars.
|
This file is the pure-Go face of the treesitter package: when the cg_skeleton tag is absent, the real cgo implementation (treesitter.go) is excluded and this empty package takes its place, so `go build ./...` under CGO_ENABLED=0 links no tree-sitter grammars. |
|
Package keepalive is the idle keep-alive: the one cache mechanism that cannot be a component.
|
Package keepalive is the idle keep-alive: the one cache mechanism that cannot be a component. |
|
Package kvcache is the KV-cache TTL domain: the per-request analysis dataset the dashboard's KV-cache page reads, the pricing model for the six things a prompt-cache policy can spend money on, the Strategy interface a TTL policy (or a future learned predictor) implements, and the historical replay simulator that scores one strategy against another.
|
Package kvcache is the KV-cache TTL domain: the per-request analysis dataset the dashboard's KV-cache page reads, the pricing model for the six things a prompt-cache policy can spend money on, the Strategy interface a TTL policy (or a future learned predictor) implements, and the historical replay simulator that scores one strategy against another. |
|
Package lifecycle is the order of the steps around one request, for every host.
|
Package lifecycle is the order of the steps around one request, for every host. |
|
Package metrics turns component/run reports into telemetry.
|
Package metrics turns component/run reports into telemetry. |
|
Package models resolves a model id to its context window and its token prices.
|
Package models resolves a model id to its context window and its token prices. |
|
litellm
Package litellm resolves model windows and prices against a LiteLLM gateway.
|
Package litellm resolves model windows and prices against a LiteLLM gateway. |
|
Package modes holds the per-session state context-guru's operating modes need.
|
Package modes holds the per-session state context-guru's operating modes need. |
|
Package predictive is the learned keep-alive policy: from the facts known when a response ends it estimates P(this conversation returns inside each ping window) and picks how many keep-alive pings are worth buying.
|
Package predictive is the learned keep-alive policy: from the facts known when a response ends it estimates P(this conversation returns inside each ping window) and picks how many keep-alive pings are worth buying. |
|
Package providerusage reads the token tiers out of a provider's `usage` block.
|
Package providerusage reads the token tiers out of a provider's `usage` block. |
|
Package proxy is the context-guru HTTP proxy: it runs the component pipeline on inbound chat requests, then forwards them to the configured upstream provider.
|
Package proxy is the context-guru HTTP proxy: it runs the component pipeline on inbound chat requests, then forwards them to the configured upstream provider. |
|
Package proxyapp re-exports the handful of internal symbols a host needs to build its own context-guru proxy binary.
|
Package proxyapp re-exports the handful of internal symbols a host needs to build its own context-guru proxy binary. |
|
metricspush
Package metricspush starts the OpenTelemetry SDK and an OTLP/JSON exporter that send a proxy's metrics to the central collector (R15).
|
Package metricspush starts the OpenTelemetry SDK and an OTLP/JSON exporter that send a proxy's metrics to the central collector (R15). |
|
Package reqfacts reads the facts a request body states: the metadata the client chose (Meta, MetaFromBody) and the tool results the request answers (Lifecycle, ScanLifecycle).
|
Package reqfacts reads the facts a request body states: the metadata the client chose (Meta, MetaFromBody) and the tool results the request answers (Lifecycle, ScanLifecycle). |
|
Package respfacts reads the facts a provider response states, from its bytes: the billed token tiers and why they could not be read (#200), the stop reason, the tool calls and their wait parameters, and the subagent spawns.
|
Package respfacts reads the facts a provider response states, from its bytes: the billed token tiers and why they could not be read (#200), the stop reason, the tool calls and their wait parameters, and the subagent spawns. |
|
Package schema holds the helpers this project layers over bifrost's message schema: token counting, deep-clone, MessageText/SetMessageText, Rewritable, ToolCalls (which pairs a tool result with the call that produced it), SessionHead, static message-SHAPE validation, and the prompt-cache breakpoint rule: MaxBreakpoints (the provider's cap), CountBreakpoints / CountBreakpointsEscaped (the one structural count of a wire body), ElemMarks, MayHoldBreakpoint and HasBlockBreakpoint.
|
Package schema holds the helpers this project layers over bifrost's message schema: token counting, deep-clone, MessageText/SetMessageText, Rewritable, ToolCalls (which pairs a tool result with the call that produced it), SessionHead, static message-SHAPE validation, and the prompt-cache breakpoint rule: MaxBreakpoints (the provider's cap), CountBreakpoints / CountBreakpointsEscaped (the one structural count of a wire body), ElemMarks, MayHoldBreakpoint and HasBlockBreakpoint. |
|
Package session resolves the conversation key that state is scoped to.
|
Package session resolves the conversation key that state is scoped to. |
|
both hosts (bifrost proxy, sidecar plugin) share it.
|
both hosts (bifrost proxy, sidecar plugin) share it. |
|
Package tenant is the control plane for a hosted, multi-user context-guru: who the users are, which token identifies them, and what configuration their traffic runs under.
|
Package tenant is the control plane for a hosted, multi-user context-guru: who the users are, which token identifies them, and what configuration their traffic runs under. |
|
Package thinkcount keeps the token count of each thinking block a model made, so the accountant can price a block at its own count when the client sends it back (accountant design D16, issue #1187).
|
Package thinkcount keeps the token count of each thinking block a model made, so the accountant can price a block at its own count when the client sends it back (accountant design D16, issue #1187). |
|
Package thread tells apart the THREADS of one session: the main agent, each subagent, each fork.
|
Package thread tells apart the THREADS of one session: the main agent, each subagent, each fork. |
|
Package tooldefer defers the tool declarations a user does not use (#485).
|
Package tooldefer defers the tool declarations a user does not use (#485). |
|
Package waitcause records WHY a thread's conversation went idle and WHY it woke up again β the signal issue #424 asks for so a later change can choose a keep-alive ping budget from real data, instead of today's fixed 2 pings per thread (see package thread and #426).
|
Package waitcause records WHY a thread's conversation went idle and WHY it woke up again β the signal issue #424 asks for so a later change can choose a keep-alive ping budget from real data, instead of today's fixed 2 pings per thread (see package thread and #426). |
Click to show internal directories.
Click to hide internal directories.