Skip to content

genMetadata augment PoC (local llama.cpp) - #1215

Draft
eschultink wants to merge 76 commits into
rc-v0.7.1from
s225-gen-metadata-poc
Draft

genMetadata augment PoC (local llama.cpp)#1215
eschultink wants to merge 76 commits into
rc-v0.7.1from
s225-gen-metadata-poc

Conversation

@eschultink

@eschultink eschultink commented May 22, 2026

Copy link
Copy Markdown
Member

PoC for LLM-generated metadata alongside sanitized fields: genMetadata augment with local GGUF via llama.cpp, building on augments framework and sentenceMetadata (OpenNLP). Latest commit adds genMetadata processing, warning headers, Dagger wiring, and Terraform enable_gen_metadata.

Features

  • genMetadata augment — structured JSON sibling +{field}:genMetadata from deployment-configured backend (BETA: local / llama.cpp)
  • Terraform enable_gen_metadata on AWS/GCP host modules — ENABLE_GEN_METADATA, 4096 MB memory floor, remote resources for GGUF weights
  • MS Copilot PoC rules (MS_COPILOT_GEN_METADATA_AUGMENT) and commented YAML example (11 categories, no confidence)
  • Non-fatal failures via X-Psoxy-Warning (augment-gen-unavailable, augment-gen-inference-failed, augment-output-schema-mismatch)

Logistics

  • Branch stacks augments PoC + sentenceMetadata + genMetadata; review as draft

Change implications

  • dependencies added/changed? yesde.kherud:llama (java-llama.cpp JNI) in psoxy-core only; see gen-metadata-augment.md
  • something important to note in future release notes?
    • New optional Terraform variable enable_gen_metadata (host + per-connector); floors memory and enables remote resource paths when set
    • New env vars: PSOXY_GEN_*, ENABLE_GEN_METADATA
    • BETA: requires GGUF at {SHARED_RESOURCE_PATH}/llm/{model}.gguf when using local backend
    • breaking changes? no (opt-in flag and augment; existing deployments unchanged)

Test plan

  • mvn test -pl gateway-core,core -am (local)
  • terraform validate in infra/examples-dev/aws and infra/examples-dev/gcp
  • Deploy with enable_gen_metadata = true, upload GGUF, exercise MS Copilot connector with genMetadata rules enabled
  • Confirm X-Psoxy-Warning when model missing (no 5xx)

Made with Cursor

eschultink and others added 22 commits May 2, 2026 08:49
…ents/Augment.java

Co-authored-by: aperez-worklytics <75276364+aperez-worklytics@users.noreply.github.com>
Add constructor injection so Dagger can provide AugmentProcessor, and suppress SLF4J/JUL warnings during gateway-core tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Ignore computed functionName during Jackson round-trips and align sanitized fixtures with augment sibling output.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Wire lazy model resolution through instance and shared remote resource paths at runtime, address review feedback on model loading and docs, and add provider tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Move ResourceService to gateway-core, drop redundant NLP wiring helpers, and return SentenceMetadataResult instead of ad-hoc maps.

Co-authored-by: Cursor <cursoragent@cursor.com>
…Maven lifecycle.

Move OpenNLP download to generate-resources so models are on the test classpath, and replace skipped assumptions with explicit assertions.

Co-authored-by: Cursor <cursoragent@cursor.com>
Introduces genMetadata augment processing, Dagger-wired config/backend, non-fatal warning headers, Terraform enable_gen_metadata (4096MB floor + remote resources), and MS Copilot PoC rules/docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@eschultink
eschultink changed the base branch from main to s225-nlp-poc May 22, 2026 03:34
@eschultink eschultink changed the title BETA: genMetadata augment PoC (local llama.cpp) genMetadata augment PoC (local llama.cpp) May 22, 2026
@eschultink eschultink self-assigned this May 22, 2026
@eschultink
eschultink requested review from Copilot and jlorper May 22, 2026 03:35
@NoArgsConstructor
@AllArgsConstructor
@Getter
@EqualsAndHashCode(callSuper = true)
An error occurred while trying to automatically change base from rc-v0.6.8 to main July 24, 2026 18:50
@eschultink
eschultink changed the base branch from main to rc-v0.6.9 July 24, 2026 19:10
eschultink and others added 5 commits July 28, 2026 15:15
Merge s225-gen-metadata-poc while preserving rc host-module features (external ALB, global enable_remote_resources) and adding per-connector genMetadata wiring.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep rc-v0.6.9 dev-example behavior alongside per-connector remote resource defaults from genMetadata wiring.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Base automatically changed from rc-v0.6.9 to main August 20, 2026 17:28
@eschultink
eschultink changed the base branch from main to rc-v0.6.10 August 20, 2026 19:11
Base automatically changed from rc-v0.6.10 to main September 3, 2026 17:40
@eschultink
eschultink changed the base branch from main to rc-v0.7.1 September 3, 2026 19:10
eschultink and others added 18 commits September 4, 2026 15:47
Co-authored-by: Cursor <cursoragent@cursor.com>
…budget.

Extend Bedrock/Vertex env, IAM, and budget wiring beyond API connectors so custom_bulk_connectors can opt in, and replace GCP's split budget vars with a single llm_budget object.

Co-authored-by: Cursor <cursoragent@cursor.com>
… from metadata.

Drop PSOXY_ branding and stop Terraform from injecting GOOGLE_CLOUD_PROJECT/REGION; resolve project via ADC and region via Cloud Run metadata.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add METADATA_GEN_MODEL_REGION so model location is configurable independently of the Cloud Function region (required for global/multi-region-only models).

Co-authored-by: Cursor <cursoragent@cursor.com>
…ing.

Gemini 3.5 Flash defaults to MEDIUM thinking, which shared the 256-token output budget and blew the 15s timeout; switch to google-genai with thinkingLevel=MINIMAL, raise default max tokens to 1024, and align classify prompts/parse recovery to JSON.

Co-authored-by: Cursor <cursoragent@cursor.com>
Exclude transcript from the broad meetings pathRegex so the genMetadata rules apply, and guard llm_budget / artifacts_bucket_name access so terraform test works when those are null.

Co-authored-by: Cursor <cursoragent@cursor.com>
Prefer the Lite Flash model for classify throughput; full Flash remains available via METADATA_GEN_MODEL.

Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid Map.toString() for genMetadata/textDigest outputs so tabular columns contain valid JSON objects.

Co-authored-by: Cursor <cursoragent@cursor.com>
Accumulate provider input/output tokens per file, log once at end of processing, and store totals in psoxy-* object metadata (with a post-write GCS metadata patch).

Co-authored-by: Cursor <cursoragent@cursor.com>
When a jsonPath matches an object ($ / $[*]), send the Map as LLM corpus and attach +self:genMetadata on it; serialize title/body first so truncation keeps the classification text.

Co-authored-by: Cursor <cursoragent@cursor.com>
Default to minimal; pass per-augment level through to Vertex (Bedrock ignores) and cache ChatModels by modelId+thinkingLevel.

Co-authored-by: Cursor <cursoragent@cursor.com>
…EVEL.

Gemini thinkingLevel is not equivalent to Bedrock Claude extended thinking, so keep it as GCP deployment config (default minimal) instead of a per-augment field.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use us.amazon.nova-2-lite-v1:0, surface Bedrock TODOs from aws-host, and add Budgets provisioner perms in psoxy-constants for cost-cap deployments.

Co-authored-by: Cursor <cursoragent@cursor.com>
amazon.nova-* foundation-model ids cannot be invoked on-demand; map them to us.amazon.nova-* so genMetadata avoids the CRIS 400.

Co-authored-by: Cursor <cursoragent@cursor.com>
Nova rejects Converse outputConfig; rely on prompt + parse/schema gate on Bedrock while Vertex keeps constrained JSON.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants