Skip to content

Add OpenAI API compatible endpoint to API #883

@davidmezzetti

Description

@davidmezzetti

Add an OpenAI API compatible endpoint. See https://github.com/openai/openai-openapi for endpoint details to implement.

This will enable users to interface with txtai using an API they are (likely) already familiar with. While txtai already has an API, this will provide another option.

Add the following endpoints:

  • /v1/chat/completions
    • model parameter controls logic path. Support llm, rag, embeddings, agents, pipelines and workflows.
  • /v1/embeddings
  • /v1/audio/speech
  • /v1/audio/transcriptions
  • /v1/audio/translations

Each endpoint will assume the necessary pipeline is enabled in the API configuration file.

Once implemented, any of the OpenAI API libraries can be used to interface with txtai.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions