Wash and dry the Thai basil leaves thoroughly.
In a food processor or blender, combine the Thai basil, nuts, garlic, lime juice, chili (if using), and a pinch of salt.
Pulse until the ingredients are finely chopped.
With the processor running, slowly drizzle in the olive oil until the mixture becomes smooth and creamy.
Taste and adjust seasoning with salt, pepper, or additional lime juice as needed.
Transfer the pesto to a jar or airtight container and refrigerate. It can be used immediately or stored for up to 1 week.