Skip to content

Prompting Fallbacks for Granite Library Intrinsics #993

Open

Description

@nrfulton

We should think about a strategy and acceptance criteria for allowing prompting fall-backs from granite library intrinsics. The construction and evaluation of those prompts (e.g., for proprietary models) should likely be owned by the developers of those libraries, but we'll need to provide infra for them.

Activity

  1. added
    area/adapter-functionsGranite adapter functions: framework and adaptiers including RAG, Guardian, Core
    enhancementNew feature or request
    on May 20, 2026
  2. added
    p2Medium/low: minor bugs, niche features, polish, docs, tests, cleanup. Scoped, lower urgency.
    on Jun 18, 2026
  3. added
    p0Critical: core-correctness/security breakage, common path, no workaround. Rare emergency bar.
    and removed
    p2Medium/low: minor bugs, niche features, polish, docs, tests, cleanup. Scoped, lower urgency.
    on Sep 3, 2026
  4. jakelorocco commented on Sep 3, 2026

    @jakelorocco
    Contributor

    Repurposing this for the prompt based io.yamls.

  5. jakelorocco commented on Sep 3, 2026

    @jakelorocco
    Contributor

    Results of meeting:

    • We will implement this for backends that support adapters already
    • We will have this be a default fallback mechanism if an adapter is not found (not a way to handle cases where exceptions are thrown)
    • We will warn if a prompt for any model is used instead of for a specific model
    • We will need to add a new prompt type for adapters / io.yaml
    • We may need to add a new AdapterType for this functionality
    • Presumably most of the work will be in writing the lookup mechanism for any based prompt adapters

    The presumed structure of the new repos will be:

    • <capability>/<model or any>/prompt/io.yaml
  6. planetf1 commented on Sep 10, 2026

    @planetf1
    Contributor

    Summary of my suggestions from an out-of-band discussion on the design (prompted by a couple of questions Alex raised):

    • Represent the prompt type as PromptBinding(WeightsBinding), a fourth binding reality alongside local_file/embedded/server_mediated, not an Optional weights field. Keeps every call site (adapter_scope etc.) working unmodified for either case.
    • prepare()/release() as genuine no-ops. activate() not — it should log that the soft adapter fired, at the same severity as a real adapter activating. That's separate from the "warn if a prompt for any model is used" case above — that warning belongs where any is chosen over model-specific, not at this normal-severity log.
    • Prompt construction reusing the existing IntrinsicsRewriter instruction-injection rather than IOContract.build_prompt — that method is unimplemented and uncalled anywhere in the codebase today. See design(adapters): IOContract.build_prompt is unimplemented and uncalled everywhere — decide whether to finish it or remove it #1644, filed separately, unrelated to this issue.
    • See design(adapters): complete server-mediated adapter binding semantics #1633 for the same "a binding owns its own behaviour" reasoning applied to ServerMediatedBinding.
  7. planetf1 commented on Sep 25, 2026

    @planetf1
    Contributor

    Two items for this issue's infra half, surfaced while reviewing #1654. Recording them here so they survive whatever that PR decides, since both are about the contract between Mellea and whoever authors the prompts.

    Mellea should validate that a prompt io.yaml can actually work. The prompt rung is implemented entirely by the rewriter injecting the io.yaml instruction, and that field is optional: only model, response_format and transformations are required. So a prompt io.yaml with no instruction resolves, registers and runs. The base model receives the bare conversation, llguidance forces the output into the declared schema, the caller gets a well-formed score, and telemetry records success. I verified that end to end. Since this issue puts prompt authoring with the library developers, Mellea is the only place that can catch it, and the failure mode is a confident wrong number rather than an error. Raised on the PR, and worth keeping in scope here in case it is deferred.

    The prompt io.yaml contract is undocumented. Nothing states what a prompt file must contain for the infrastructure to work: instruction is required in practice though optional in the schema, response_format drives constrained decoding and so is load-bearing, and parameters carries the token caps the trained adapters set (the published files use 15 for requirement-check and uncertainty, 4096 for citations). The consumer of that contract is a different team, so writing it down is part of providing the infra rather than a docs nicety.

    Neither is a blocker for the LocalHF work. Both are cheap now and awkward later, once prompt files exist upstream and a malformed one is already in someone's cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/adapter-functionsGranite adapter functions: framework and adaptiers including RAG, Guardian, CoreenhancementNew feature or requestp0Critical: core-correctness/security breakage, common path, no workaround. Rare emergency bar.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions