Skip to content

feat: support token ids in /v1/completions#736

Merged
Ying1123 merged 1 commit intosgl-project:mainfrom
toslunar:feat-openai-completion-token-ids
Jul 26, 2024
Merged

feat: support token ids in /v1/completions#736
Ying1123 merged 1 commit intosgl-project:mainfrom
toslunar:feat-openai-completion-token-ids

Conversation

@toslunar
Copy link
Copy Markdown
Contributor

Motivation

Improve compatibility with OpenAI API.

Modification

prompt of /v1/completions is

a string, array of strings, array of tokens, or array of token arrays.

https://platform.openai.com/docs/api-reference/completions/create#completions-create-prompt

Support array of tokens and array of token arrays.

Checklist

  • 1. Ensure pre-commit pre-commit run --all-files or other linting tools are used to fix potential lint issues.
  • 2. Confirm that modifications are covered by complete unit tests. If not, please add more unit tests for correctness.
  • 3. Modify documentation as needed, such as docstrings or example tutorials.

@Ying1123 Ying1123 merged commit 40facad into sgl-project:main Jul 26, 2024
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants