Skip to content

Add support for 4.1 and 4.5 models#1

Merged
kuzminT merged 5 commits intomainfrom
Add_support_for_4.1_model
Jul 11, 2025
Merged

Add support for 4.1 and 4.5 models#1
kuzminT merged 5 commits intomainfrom
Add_support_for_4.1_model

Conversation

@kuzminT
Copy link

@kuzminT kuzminT commented Jul 11, 2025

  • Adds support for new OpenAI model variants: gpt-4.1 and gpt-4.5. These models currently cause errors when used with this library.
  • Related to the upstream PR in the original repository.

@kuzminT kuzminT self-assigned this Jul 11, 2025
@kuzminT kuzminT changed the title Add support for 4.1 model Add support for 4.1 and 4.5 model Jul 11, 2025
@kuzminT kuzminT changed the title Add support for 4.1 and 4.5 model Add support for 4.1 and 4.5 models Jul 11, 2025
@kuzminT kuzminT requested a review from Copilot July 11, 2025 12:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for the new gpt-4.1 and gpt-4.5 model variants by mapping them to the existing o200k_base encoding and updating the README to reflect those additions.

  • Introduce exact and prefix-based mappings for gpt-4.1 and gpt-4.5 in encoding.go
  • Update documentation tables in README.md to list the new models under available encodings and models

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
encoding.go Added "gpt-4.1" and "gpt-4.5" entries to both MODEL_TO_ENCODING and MODEL_PREFIX_TO_ENCODING maps
README.md Expanded tables and prose to include gpt-4.1 and gpt-4.5 in the available encodings/models sections
Comments suppressed due to low confidence (3)

encoding.go:25

  • Add or update unit tests to cover the new mappings for gpt-4.5 and gpt-4.1 so that encoding lookups for these models are validated.
	"gpt-4.5":       MODEL_O200K_BASE,

encoding.go:72

  • The inline comment example still references gpt-4o-.... Update it to gpt-4.5-... to match this mapping.
	"gpt-4.5-":       MODEL_O200K_BASE,  // e.g., gpt-4o-2024-05-13, etc.

encoding.go:73

  • The inline comment example still references gpt-4o-.... Update it to gpt-4.1-... to reflect this prefix mapping correctly.
	"gpt-4.1-":       MODEL_O200K_BASE,  // e.g., gpt-4o-2024-05-13, etc.

@kuzminT kuzminT enabled auto-merge July 11, 2025 14:31
@kuzminT kuzminT disabled auto-merge July 11, 2025 14:37
@kuzminT kuzminT added this pull request to the merge queue Jul 11, 2025
Merged via the queue into main with commit ff220c2 Jul 11, 2025
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 this pull request may close these issues.

2 participants