Skip to content

Model accepts arbitrary parameters without validation or warnings #2184

@MaxGhenis

Description

@MaxGhenis

The LanguageModel class accepts any kwargs and silently stores them as attributes without validation. This causes silent failures when users make typos or use unsupported parameters.

Example:

# All of these are accepted without error:
m = Model('gpt-4o-mini', 
    temprature=0.7,  # Typo - should be temperature
    unicorn_mode=True,  # Complete nonsense
    n=5)  # Real parameter that seems to work but doesn't

Root cause: In language_model.py lines 240-242:

for key, value in kwargs.items():
    if key not in parameters:
        setattr(self, key, value)  # Accepts anything

Suggested fix:
Either validate against known parameters or at least warn when unknown parameters are provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions