Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model gpt-4o-realtime-preview-2024-10-01 should not be hardcoded #89

Open
michitomo opened this issue Dec 20, 2024 · 16 comments · May be fixed by #90
Open

Model gpt-4o-realtime-preview-2024-10-01 should not be hardcoded #89

michitomo opened this issue Dec 20, 2024 · 16 comments · May be fixed by #90

Comments

@michitomo
Copy link

Issue:

  • It won't allow using other models than the hardcoded model gpt-4o-realtime-preview-2024-10-01
  • A new model gpt-4o-realtime-preview-2024-12-17 has been released with lower price.
  • Alias gpt-4o-realtime-preview is also available

Expected:

  • Library consumers should be able to specify models they choose
  • The library should point model alias instead of a specific dated model
@michitomo michitomo linked a pull request Dec 20, 2024 that will close this issue
@Van0SS
Copy link

Van0SS commented Dec 20, 2024

+1 this is very strange to discover and appreciate the PR!

@Kotoryu
Copy link

Kotoryu commented Dec 20, 2024

+1 totally agree, we should have possibility to change the model.

@yanaocean
Copy link

+1 agree!

@hinke
Copy link

hinke commented Dec 22, 2024

+1 !!

@BraveTiger0408
Copy link

❤A new model gpt-4o-realtime-preview-2024-12-17 has been released with lower price.❤
Thank you.

@jjmlovesgit
Copy link

jjmlovesgit commented Jan 1, 2025

please see: #92
#92 This PR introduces the ability to select a custom OpenAI realtime model in the RealtimeClient. Users can now specify the desired model for more flexibility and tailored API usage.

@sidoh
Copy link

sidoh commented Jan 13, 2025

As a workaround, you can call client.realtime.connect directly:

export const DEFAULT_REALTIME_MODEL = "gpt-4o-realtime-preview-2024-12-17";
// ...
await client.realtime.connect({ model: DEFAULT_REALTIME_MODEL });
await client.updateSession();

The connect method in RealtimeClient is just a thin wrapper around RealtimeAPI.connect.

@CROprogrammer
Copy link

As a workaround, you can call client.realtime.connect directly:

export const DEFAULT_REALTIME_MODEL = "gpt-4o-realtime-preview-2024-12-17";
// ...
await client.realtime.connect({ model: DEFAULT_REALTIME_MODEL });
await client.updateSession();
The connect method in RealtimeClient is just a thin wrapper around RealtimeAPI.connect.

Do you maybe have an idea why function calling does not work when I define model like this instead of using client.connect()

@Dev-lesmemoires
Copy link

Dev-lesmemoires commented Jan 16, 2025

I've tried the method above, even though you can see chatgpt-4o-mini-model in websocket tab, You still end up getting charged for chatgpt 4 main model on your usage history. No usage logs for 4o mini

Image

Image

@sidoh
Copy link

sidoh commented Jan 16, 2025

Odd, it's definitely working for me! Are you using a relay?

Image

@Dev-lesmemoires
Copy link

Dev-lesmemoires commented Jan 20, 2025

Odd, it's definitely working for me! Are you using a relay?

Image

Yup, aren't you getting charged for gpt-4o-realtime-preview instead of getting gpt-4o-mini-realtime-preview?

@sidoh
Copy link

sidoh commented Jan 20, 2025

Odd, it's definitely working for me! Are you using a relay?
Image

Yup, aren't you getting charged for gpt-4o-realtime-preview instead of getting gpt-4o-mini-realtime-preview?

The code I suggested needs to be run on the relay server, not the client.

Yes, but it's gpt-4o-realtime-preview-2024-12-17, which is different than the hardcoded version (gpt-4o-realtime-preview-2024-10-01).

@sidoh
Copy link

sidoh commented Jan 20, 2025

As a workaround, you can call client.realtime.connect directly:
export const DEFAULT_REALTIME_MODEL = "gpt-4o-realtime-preview-2024-12-17";
// ...
await client.realtime.connect({ model: DEFAULT_REALTIME_MODEL });
await client.updateSession();
The connect method in RealtimeClient is just a thin wrapper around RealtimeAPI.connect.

Do you maybe have an idea why function calling does not work when I define model like this instead of using client.connect()

Not sure. I use function calling in my application and noticed no difference when I swapped models. The realtime models' tool-calling abilities have seemed far more sensitive to temperature than I've expected. If you're not already, maybe try using the default value for temperature.

@jjmlovesgit
Copy link

Quick Fix -- Go and edit the hardcoded Node file and move it to gpt-4o-realtime-preview-2024-12-17 app.js

Image

Image

@Dev-lesmemoires
Copy link

Dev-lesmemoires commented Jan 21, 2025

I did more digging around. The relay server issue is coming from this. If you're using a relay server you definitely need the fix below
#52

Just fork the repo and add this fix and link it back to your project. That's how I did it. Check devtools of relay server

Image

@sidoh
Copy link

sidoh commented Jan 21, 2025

It really is this easy: #89 (comment)

You just have to make those changes in the right place (i.e., where you're actually connecting to OpenAI :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants