Skip to content

Incompatibility between OpenAI and HF's Chat Completion response_format #932

@sadra-barikbin

Description

@sadra-barikbin

Hi there!

OpenAI and HF api seem to have diverged on chat_completion response_format. That of the OpenAI has a type attribute which takes one of three values text, json_object (free-form JSON generation which isn't in TGI yet) and json_schema, and for the last one it has another json_schema attribute which itself contains name, schema, description and strict attributes.

On the other hand, HF's response_format: ChatCompletionInputGrammarType contains type and value attributes.

This might break the OpenAI api usability on HF models. Could we have compatibility between these two on this matter? Or does it need probably breaking changes in TGI and huggingface_hub?

@Wauplin

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