Skip to content

Conversation

@tarekgh
Copy link
Member

@tarekgh tarekgh commented Aug 9, 2025

Fixes #7491

Copilot AI review requested due to automatic review settings August 9, 2025 23:29
Copy link
Contributor

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

This PR adds support for OpenAI OSS (Open Source Software) models using the Tiktoken tokenizer by introducing a new encoding type o200k_harmony and supporting the gpt-oss model family.

  • Introduces a new O200kHarmony encoding with specialized special tokens for OSS models
  • Adds comprehensive test coverage for the new tokenizer functionality
  • Expands model name mappings to include various OpenAI model variations and fine-tuned models

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Microsoft.ML.Tokenizers/Model/TiktokenTokenizer.cs Adds O200kHarmony encoding support, new special tokens, and expanded model mappings for gpt-oss and fine-tuned models
test/Microsoft.ML.Tokenizers.Tests/TiktokenTests.cs Adds comprehensive test coverage for the new OSS tokenizer including encoding tests and special token validation

@tarekgh
Copy link
Member Author

tarekgh commented Aug 9, 2025

CC @stephentoub @ericstj

@stephentoub
Copy link
Member

Thanks

@stephentoub
Copy link
Member

We should also add gpt-5:
openai/tiktoken@5818d56#diff-0d973848bd229418209db2c46c86167000845592ca6b98fad215c21c317bc494R12

@tarekgh tarekgh merged commit fb39755 into dotnet:main Aug 11, 2025
25 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorporate new harmony tiktoken vocabulary

2 participants