How to reduce your expense on tokens in prompts

something important i just figured out - if you have file names, don’t bother including the extensions when feeding through a prompt layer - it adds a significant amount of tokens as it treats each character or extension as a seperate word (logically should, but doesnt actually need to since it can contextualize that in single phrases like nextjs or typescript etc).

this should make your outputs a lot more reasonable token-wize if you’re working with something large. and then you can reappend the filenames later to the output it generates from the api call.

1 Like

I should note the reason I did this was to get my large response from a multiprompt to fit inside of 4096 tokens to be the “most capable” when handling large inputs to the parent prompt