Thinly slice the chiles and the garlic. Slice the garlic crosswise into thin coins rather than mincing — several Thai sources specify this for texture.
Combine the fish sauce and lime juice in a small bowl. Stir in the sugar, if using, until dissolved.
Add the sliced chiles, garlic, and shallot (if using). Stir.
Let rest 10 minutes so the chiles and garlic infuse the sauce, then taste and adjust: more lime for sour, more chiles for heat, a pinch more sugar to round it out.
Serve in a small dish at the table with a spoon.