Skip to content

OpenAIBackend logs a per-call INFO message when using non-OpenAI providers — should log once at init or at DEBUG #1502

Description

@planetf1

Summary

When OpenAIBackend is pointed at a non-OpenAI endpoint (vLLM, Ollama, LiteLLM, OpenRouter with non-OpenAI models, etc.) and format= is passed, it logs this message on every inference call:

"Mellea assumes you are NOT using the OpenAI platform, and that other model providers have less strict requirements on supporting JSON schemas passed into format=. If you encounter a server-side error following this message, then you found an exception to this assumption. Please open an issue..."

With @generative functions the schema is passed on every call, so every call generates this line. In a loop of 100 calls against a vLLM endpoint the log fills up with 100 identical lines.

Location

mellea/backends/openai.py ~line 936 — inside the generate() hot path, inside the _format is not None / else branch.

Expected behaviour

The message should appear once per backend instance (at construction time, or on first use) or be dropped to DEBUG level. It is an internal assumption note, not an actionable warning for the user. The only time it is actionable is when a server error actually follows it — at which point the user already has a stack trace.

Proposed fix

Either:

  1. Move the log call into __init__ when _server_type != _ServerType.OPENAI, so it fires once, or
  2. Change MelleaLogger.get_logger().info(...).debug(...) so it does not appear at the default INFO level.

Option 2 is a one-line fix. Option 1 is slightly more correct since it ties the message to backend setup rather than the generate loop.

Related

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