Skip to content

feat: enable full liter-llm configuration #1381

Description

@clashofphish

What is the proposed feature?

The current implementation of liter-llm has support for AWS Bedrock, but this is not turned on within xberg. Here is the summary of what I have found regarding this request.

Summary

The vlm OCR backend with a bedrock/... model (e.g. bedrock/amazon.nova-pro-v1:0) always fails, regardless of AWS credentials:
Error: OCR error: VLM OCR request failed: model=bedrock/amazon.nova-pro-v1:0, language=eng, image_size=998KB: authentication failed: {"Message":"Authorization header is missing"}

Tried static keys and a fresh SSO session exported via aws configure export-credentials — same error either way. The request reaches AWS with no Authorization header at all, so this isn't a credentials issue; SigV4 signing simply isn't compiled into the binary.

##Root cause

liter-llm's BedrockProvider only signs requests when built with its own bedrock feature (crates/liter-llm/Cargo.toml:47). Without it, signing_headers() (bedrock.rs:598-609) takes the #[cfg(not(feature = "bedrock"))] branch and returns an empty header vector, and auth_header() always returns None for Bedrock — so the request goes out unsigned.

xberg's crates/xberg/Cargo.toml pins liter-llm with features = ["native-http"] only, on every target (non-Windows: line 1098, Windows: line 1130, wasm32: line 1206) — bedrock is never requested. xberg exposes no feature of its own to opt in, and publish.yaml CI never adds it either, so every prebuilt @xberg-io/xberg-* binary ships with Bedrock signing compiled out.

This looks like a pure packaging gap, not an app-level bug — vlm_ocr.rs/client.rs build a generic request and hand it to liter_llm::DefaultClient with no Bedrock-specific logic of their own.

Reproduction

import { extract } from "@xberg-io/xberg";

await extract(
  { kind: "uri", uri: "some.pdf" },
  { ocr: { enabled: true, backend: "vlm", language: ["eng"], forceOcr: true,
           vlmConfig: { model: "bedrock/amazon.nova-pro-v1:0" } } },
);

With AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_SESSION_TOKEN correctly exported.

Expected: signed SigV4 request, Bedrock returns a completion.
Actual: {"Message":"Authorization header is missing"}, independent of credential validity.

Environment

@xberg-io/xberg 1.0.11 (pins liter-llm 1.13.0) — same gating confirmed present in both latest releases
macOS, @xberg-io/xberg-darwin-arm64, Node v22

Why would this be a good addition?

The support for AWS Bedrock already exists in liter-llm. It just needs to be turned on for xberg. I have already confirmed this works locally by enabling it myself.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestv1.1.0Targeted for the v1.1.0 release

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions