Skip to content

ModelOption: design a comprehensive validation strategy #1148

@psschwei

Description

@psschwei

Context

Mellea's ModelOption sentinels (e.g. STOP_SEQUENCES, TEMPERATURE, MAX_NEW_TOKENS) are passed through to backends with no type or value validation. Today, an invalid value typically surfaces as a confusing backend-specific error (or silently misbehaves) far from the user's call site.

This came up concretely in #1112: STOP_SEQUENCES requires list[str] for uniform behavior across backends — a bare str works on OpenAI/LiteLLM but breaks HuggingFace's stop_strings. A per-option validate_stop_sequences helper was prototyped there but pulled out, since validating one option in isolation creates inconsistency with the rest.

What we want

We need a single, consistent strategy for validating ModelOption values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/backendsProvider-specific work: Ollama, HF, LiteLLM, OpenAI, Bedrock, vLLMenhancementNew feature or requestneeds-designProblem is clear; implementation approach needs design discussion before work starts

    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