File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 11import os
22import threading
3- from typing import Any , Dict , List
3+ from typing import Any , Dict
44
55import uvicorn
66from fastapi import FastAPI , HTTPException
7- from langfuse . openai import openai # pyright: ignore[reportPrivateImportUsage]
7+ from openai import OpenAI
88
99from eval_protocol .types .remote_rollout_processor import (
1010 InitRequest ,
1111 StatusResponse ,
12- create_langfuse_config_tags ,
1312)
14- from eval_protocol .models import Message
1513
1614
1715app = FastAPI ()
@@ -28,21 +26,20 @@ def init(req: InitRequest):
2826 # Kick off worker thread that does a single-turn chat via Langfuse OpenAI integration
2927 def _worker ():
3028 try :
31- metadata = {"langfuse_tags" : create_langfuse_config_tags (req )}
32-
3329 if not req .messages :
3430 raise ValueError ("messages is required" )
3531
3632 completion_kwargs = {
3733 "model" : req .model ,
3834 "messages" : req .messages ,
39- "metadata" : metadata ,
4035 }
4136
4237 if req .tools :
4338 completion_kwargs ["tools" ] = req .tools
4439
45- completion = openai .chat .completions .create (** completion_kwargs )
40+ client = OpenAI (base_url = req .model_base_url , api_key = os .environ .get ("FIREWORKS_API_KEY" ))
41+
42+ completion = client .chat .completions .create (** completion_kwargs )
4643
4744 except Exception as e :
4845 # Best-effort; mark as done even on error to unblock polling
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ def rows() -> List[EvaluationRow]:
5656
5757
5858@pytest .mark .skipif (os .environ .get ("CI" ) == "true" , reason = "Only run this test locally (skipped in CI)" )
59- @pytest .mark .parametrize ("completion_params" , [{"model" : "gpt-4o " }])
59+ @pytest .mark .parametrize ("completion_params" , [{"model" : "fireworks_ai/accounts/fireworks/models/ gpt-oss-120b " }])
6060@evaluation_test (
6161 data_loaders = DynamicDataLoader (
6262 generators = [rows ],
@@ -65,6 +65,7 @@ def rows() -> List[EvaluationRow]:
6565 remote_base_url = "http://127.0.0.1:3000" ,
6666 timeout_seconds = 30 ,
6767 output_data_loader = langfuse_output_data_loader ,
68+ model_base_url = "https://tracing.fireworks.ai/project_id/cmg5fd57b0006y107kuxkcrhk" ,
6869 ),
6970)
7071async def test_remote_rollout_and_fetch_langfuse (row : EvaluationRow ) -> EvaluationRow :
You can’t perform that action at this time.
0 commit comments