A warning about tiktoken, BPE, and OpenAI models

from blog Simon Willison's Weblog, | ↗ original
A warning about tiktoken, BPE, and OpenAI models Tom MacWright warns that OpenAI's tiktoken Python library has a surprising performance profile: it's superlinear with the length of input, meaning someone could potentially denial-of-service you by sending you a 100,000 character string if you're passing that directly to tiktoken.encode(). There's...