Skip to content

Add the legacy /completions endpoint  #170

Closed

Description

@codelion

Support the /completions endpoint for inbuilt inference server.

Originally posted by @SeriousJ55 in #168 (reply in thread)

Activity

  1. akushonkamen commented on Oct 10, 2026

    @akushonkamen
    Contributor

    Hi @codelion — I'd like to pick this up. The built-in inference server currently only exposes the chat protocol at optillm/server.py /v1/chat/completions (server.py:759); there is no legacy text-completions route.

    Plan: extract the request-parsing/dispatch core of proxy() into a shared internal helper (no behavior change for chat), then add POST /v1/completions that maps prompt → messages and returns the OpenAI legacy object: "text_completion" shape (choices[].text + usage, multiple choices for list prompts / n>1). Stream: first version returns 400 with a clear message (can follow up). Offline unit tests via server.app.test_client() following tests/test_approaches.py. PR incoming shortly — please confirm the first-version scope looks right.

  2. added a commit that references this issue on Oct 10, 2026
    086c678
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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