Arize-ai / phoenix

AI Observability & Evaluation
https://docs.arize.com/phoenix
Other
3.53k stars 262 forks source link

[BUG] Wrong GPT version displayed in the trace interface #4717

Open Howie-Arup opened 1 week ago

Howie-Arup commented 1 week ago

Describe the bug I am using Phoenix to trace my LLM application locally. My open AI key is GPT 4. But when I open the tracing interface in the browser, it shows that it's GPT 3.5 Turbo, as shown in the screenshot below.

To Reproduce Steps to reproduce the behavior:

azure_api_key = "..."
azure_endpoint = "..."
azure_api_version = "2024-02-15-preview" # "2023-07-01-preview" "2023-12-01-preview" "2024-02-15-preview"

embed_azure_api_key = "..."
embed_azure_endpoint = "..."
embed_azure_api_version = "2023-12-01-preview" # "2023-07-01-preview" "2023-12-01-preview"

OpenAI_LLM_name = "gpt-4-1106-preview" #'gpt-35-turbo', 'gpt-4' 'gpt-4-1106-preview"
OpenAI_Embedding_model_name = "text-embedding-ada-002"

os.environ["OPENAI_API_VERSION"] = azure_api_version 
os.environ["AZURE_OPENAI_ENDPOINT"] = azure_endpoint
os.environ["AZURE_OPENAI_API_KEY"] = azure_api_key

os.environ["AZURE_OPENAI_VERSION"] = azure_api_version 
os.environ["AZURE_OPENAI_DEPLOYMENT"] = OpenAI_LLM_name
os.environ["AZURE_OPENAI_KEY"] = azure_api_key

# ... Codes of the LLM application 

# Save
directory = 'traces'
trace_id = px.Client().get_trace_dataset().save(directory=directory)

# Load
trace_dataset = px.TraceDataset.load(trace_id, directory=directory)
px.launch_app(trace=trace_dataset)

The after openning the browser, it shows gpt-35-turbo.

Expected behavior The interface shows gpt 4 correctly.

Screenshots image

Environment (please complete the following information):

axiomofjoy commented 6 days ago

Thanks for reporting @Howie-Arup. Just to double-check, are you using openinference-instrumentation-openai?

Howie-Arup commented 6 days ago

openinference-instrumentation-openai

Thanks for reply @axiomofjoy. I am not using the openinference-instrumentation-openai library.

axiomofjoy commented 2 days ago

Hey @Howie-Arup, what instrumentation library are you using to create your traces?

Howie-Arup commented 12 hours ago

Hi @axiomofjoy I am usingLlamaIndex

px.launch_app()
llama_index.core.set_global_handler("arize_phoenix")