Skip to content

Add detokenize (tokens to text) method to Python SDK #156

@FBTCAD

Description

@FBTCAD

Description:
The Python SDK currently provides a .tokenize() method to convert text into token IDs, but there is no .detokenize() (decode) method to convert token IDs back to text. This feature is important for chunking workflows, debugging custom inputs/outputs, and for compatibility with other token-based workflows (similar to Hugging Face's decode). Please consider adding .detokenize(token_ids) to allow round-trip conversion between text and token IDs.

Use Case:

  • Splitting large text based on token count and reconstructing text for summarization or analysis.
  • Making LM Studio SDK workflows more flexible and developer-friendly.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions