Merge pull request #4000 from pipecat-ai/mb/fix-openai-default-model

Fix: Restore default model to gpt-4.1 for OpenAI, Azure
This commit is contained in:
Mark Backman
2026-03-11 16:29:51 -04:00
committed by GitHub
8 changed files with 6 additions and 9 deletions

1
changelog/4000.fixed.md Normal file
View File

@@ -0,0 +1 @@
- Fixed an issue where the default model for `OpenAILLMService` and `AzureLLMService` was mistakenly reverted to `gpt-4o`. The defaults are now restored to `gpt-4.1`.

View File

@@ -58,7 +58,6 @@ async def main():
llm = OpenAILLMService( llm = OpenAILLMService(
api_key=os.getenv("OPENAI_API_KEY"), api_key=os.getenv("OPENAI_API_KEY"),
settings=OpenAILLMService.Settings( settings=OpenAILLMService.Settings(
model="gpt-4o",
system_instruction="You are a helpful LLM in a WebRTC call. Your goal is to demonstrate your capabilities in a succinct way. Your output will be spoken aloud, so avoid special characters that can't easily be spoken, such as emojis or bullet points. Respond to what the user said in a creative and helpful way.", system_instruction="You are a helpful LLM in a WebRTC call. Your goal is to demonstrate your capabilities in a succinct way. Your output will be spoken aloud, so avoid special characters that can't easily be spoken, such as emojis or bullet points. Respond to what the user said in a creative and helpful way.",
), ),
) )

View File

@@ -79,7 +79,6 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
instructions="Please speak clearly and at a moderate pace.", instructions="Please speak clearly and at a moderate pace.",
) )
# model choices: gpt-4o, gpt-4.1, etc.
llm = OpenAILLMService( llm = OpenAILLMService(
api_key=os.getenv("OPENAI_API_KEY"), api_key=os.getenv("OPENAI_API_KEY"),
settings=OpenAILLMService.Settings( settings=OpenAILLMService.Settings(

View File

@@ -73,7 +73,6 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
llm = OpenAILLMService( llm = OpenAILLMService(
api_key=os.getenv("OPENAI_API_KEY"), api_key=os.getenv("OPENAI_API_KEY"),
settings=OpenAILLMService.Settings( settings=OpenAILLMService.Settings(
model="gpt-4o-mini",
system_instruction="You are a helpful LLM in a WebRTC call. Your goal is to demonstrate your capabilities in a succinct way. Your output will be spoken aloud, so avoid special characters that can't easily be spoken, such as emojis or bullet points. Respond to what the user said in a creative and helpful way.", system_instruction="You are a helpful LLM in a WebRTC call. Your goal is to demonstrate your capabilities in a succinct way. Your output will be spoken aloud, so avoid special characters that can't easily be spoken, such as emojis or bullet points. Respond to what the user said in a creative and helpful way.",
), ),
) )

View File

@@ -24,7 +24,7 @@ The PatternPairAggregator:
- Returns processed text at sentence boundaries - Returns processed text at sentence boundaries
Requirements: Requirements:
- OpenAI API key (for GPT-4o) - OpenAI API key
- Cartesia API key (for text-to-speech) - Cartesia API key (for text-to-speech)
- Daily API key (for video/audio transport) - Daily API key (for video/audio transport)

View File

@@ -24,7 +24,7 @@ Example usage (run from pipecat root directory):
$ python examples/foundational/37-mem0.py $ python examples/foundational/37-mem0.py
Requirements: Requirements:
- OpenAI API key (for GPT-4o-mini) - OpenAI API key
- ElevenLabs API key (for text-to-speech) - ElevenLabs API key (for text-to-speech)
- Daily API key (for video/audio transport) - Daily API key (for video/audio transport)
- Mem0 API key (for cloud-based memory storage) - Mem0 API key (for cloud-based memory storage)
@@ -226,7 +226,6 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
llm = OpenAILLMService( llm = OpenAILLMService(
api_key=os.getenv("OPENAI_API_KEY"), api_key=os.getenv("OPENAI_API_KEY"),
settings=OpenAILLMService.Settings( settings=OpenAILLMService.Settings(
model="gpt-4o-mini",
system_instruction="""You are a personal assistant. You can remember things about the person you are talking to. system_instruction="""You are a personal assistant. You can remember things about the person you are talking to.
Some Guidelines: Some Guidelines:
- Make sure your responses are friendly yet short and concise. - Make sure your responses are friendly yet short and concise.

View File

@@ -47,7 +47,7 @@ class AzureLLMService(OpenAILLMService):
Args: Args:
api_key: The API key for accessing Azure OpenAI. api_key: The API key for accessing Azure OpenAI.
endpoint: The Azure endpoint URL. endpoint: The Azure endpoint URL.
model: The model identifier to use. Defaults to "gpt-4o". model: The model identifier to use. Defaults to "gpt-4.1".
.. deprecated:: 0.0.105 .. deprecated:: 0.0.105
Use ``settings=AzureLLMService.Settings(model=...)`` instead. Use ``settings=AzureLLMService.Settings(model=...)`` instead.
@@ -58,7 +58,7 @@ class AzureLLMService(OpenAILLMService):
**kwargs: Additional keyword arguments passed to OpenAILLMService. **kwargs: Additional keyword arguments passed to OpenAILLMService.
""" """
# 1. Initialize default_settings with hardcoded defaults # 1. Initialize default_settings with hardcoded defaults
default_settings = self.Settings(model="gpt-4o") default_settings = self.Settings(model="gpt-4.1")
# 2. Apply direct init arg overrides (deprecated) # 2. Apply direct init arg overrides (deprecated)
if model is not None: if model is not None:

View File

@@ -151,7 +151,7 @@ class BaseOpenAILLMService(LLMService):
""" """
# 1. Initialize default_settings with hardcoded defaults # 1. Initialize default_settings with hardcoded defaults
default_settings = self.Settings( default_settings = self.Settings(
model="gpt-4o", model="gpt-4.1",
system_instruction=None, system_instruction=None,
frequency_penalty=NOT_GIVEN, frequency_penalty=NOT_GIVEN,
presence_penalty=NOT_GIVEN, presence_penalty=NOT_GIVEN,