Skip to content

Missing example: structured output with Custom Model Import (CMI) #711

Description

@manuwaik

Problem

The custom-models/ directory has examples for fine-tuning, distillation, and importing models, but nothing showing how to use Bedrock's structured output (response_format with a JSON schema) against a CMI model.

CMI supports OpenAIChatCompletion, OpenAICompletion, and BedrockCompletion request shapes, and the response_format parameter varies between them — this is a common source of confusion when adapting foundation-model code to imported models.

Proposal

Add a notebook under custom-models/ that:

  • Demonstrates schema-constrained generation against a CMI model via InvokeModel using OpenAIChatCompletion.
  • Uses Pydantic to define the schema as a single source of truth for both the response_format constraint and downstream validation.
  • Shows the contrast vs. prompted-JSON (baseline) so readers understand what schema enforcement buys them.

References

PR #710 implements this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions