lm-sys/FastChat
View on GitHubpresence_penalty and repetition_penalty in completions endpoint
Open
#1,914 opened on Jul 10, 2023
1 comment (1 comment)0 reactions (0 reactions)0 assignees (0 assignees)Python38,959 stars (38,959 stars)4,736 forks (4,736 forks)batch import
good first issue
Description
Are there plans to add presence_penalty and repetition_penalty to the OpenAI Completions endpoint?
Contributor guide
- Tech stack
- pythonrest api
- Domain
- backendapi
- Issue type
- feature
- DifficultyEstimated implementation difficulty for a new contributor, from 1 for very small changes to 5 for expert-level work.
- 3
- Estimated timeA rough time range for an experienced contributor to investigate, implement, test, and prepare a pull request.
- 1-3 hours
- Activity statusHow available the issue appears right now: fresh, active, stale, blocked, or waiting on maintainer input.
- fresh
- ClarityHow clearly the issue explains the expected change, acceptance criteria, and next step.
- clear
- Prerequisites
- Familiarity with FastChat codebaseUnderstanding of OpenAI API parameters
- Newbie friendlinessA 1-100 score estimating how approachable this issue is for first-time contributors.
- 60
- Research direction
- Start by examining the current implementation of the completions endpoint in FastChat. Look for how existing parameters like temperature are parsed and passed to the underlying model. The `presence penalty` and `repetition penalty` are standard OpenAI API parameters that control output diversity. Check if the OpenAI wrapper used in FastChat already supports these parameters or if they need to be added. Examine the relevant files in the `fastchat/serve` directory, particularly the model worker and controller. Ensure that the new parameters are added to the request schema and passed through to the model call. The issue has only one comment from a maintainer (if any), so no additional clarification is needed, but it may be worth asking if the parameters should be implemented at the API level or if they are already available but undocumented.