[object Object]

← back to Exo

fix: map presence_penalty and frequency_penalty from ChatCompletionRequest (#1991)

48a922fd5c23108fdd19b00106306023b335a8e1 · 2026-04-27 03:58:59 -0500 · Adam Durham

Upstream PR #1947 added `presence_penalty` and `frequency_penalty` to
`TextGenerationTaskParams` and the mlx-lm generator call sites, but
missed wiring them up in the API adapter so they were silently dropped
from incoming requests. This fixes the API mapping.

Co-authored-by: Adam Durham <adam@example.com>

Files touched

Diff

commit 48a922fd5c23108fdd19b00106306023b335a8e1
Author: Adam Durham <amdnative@gmail.com>
Date:   Mon Apr 27 03:58:59 2026 -0500

    fix: map presence_penalty and frequency_penalty from ChatCompletionRequest (#1991)
    
    Upstream PR #1947 added `presence_penalty` and `frequency_penalty` to
    `TextGenerationTaskParams` and the mlx-lm generator call sites, but
    missed wiring them up in the API adapter so they were silently dropped
    from incoming requests. This fixes the API mapping.
    
    Co-authored-by: Adam Durham <adam@example.com>
---
 src/exo/api/adapters/chat_completions.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/exo/api/adapters/chat_completions.py b/src/exo/api/adapters/chat_completions.py
index 6dd5d7c1..3797bd5b 100644
--- a/src/exo/api/adapters/chat_completions.py
+++ b/src/exo/api/adapters/chat_completions.py
@@ -168,6 +168,8 @@ async def chat_request_to_text_generation(
         min_p=request.min_p,
         repetition_penalty=request.repetition_penalty,
         repetition_context_size=request.repetition_context_size,
+        presence_penalty=request.presence_penalty,
+        frequency_penalty=request.frequency_penalty,
         images=images,
     )
 

← fd707de3 Add more model cards (#1970)  ·  back to Exo  ·  Add DeepSeek V4 Flash/Pro (#1978) 37f6f4f6 →