LocalAI icon indicating copy to clipboard operation
LocalAI copied to clipboard

WIP: OpenAI + OpenAPI [Code Generation]

Open dave-gray101 opened this issue 1 year ago • 0 comments

THIS PR IS NOT READY TO MERGE!

Go Read todo.md, it's probably out of date, but probably more up to date than this!

This PR is an early vertical slice demo of something I've been working on. Rather than define our own models entirely from scratch, this PR takes a different approach. All additional LocalAI-specific configuration fields are moved to optional extension objects, and appended to the existing, OpenAI-published OpenAPI specifications. We then generate a server that matches these endpoints exactly, giving us a stable reference for what official clients will expect. As an additional bonus, LocalAI-specific clients can easily become aware of and tweak these variables.

Some notes:

  • Early times! This only implements some backends, and only some endpoints! I'm adding the rest over time!
  • I am a golang newbie! This is being published to seek feedback on where we should improve things early and often.

dave-gray101 avatar Jun 12 '23 22:06 dave-gray101