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.
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_formatwith a JSON schema) against a CMI model.CMI supports
OpenAIChatCompletion,OpenAICompletion, andBedrockCompletionrequest shapes, and theresponse_formatparameter 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:InvokeModelusingOpenAIChatCompletion.response_formatconstraint and downstream validation.References
PR #710 implements this.