imprecate – that is, those that invoke judgment, calamity or curses upon one's enemies or those perceived as the enemies of God
There is a category of psalms called Imprecatory Psalms:
Major imprecatory Psalms include Psalm 69 and Psalm 109, while Psalms 5, 6, 11, 12, 35, 37, 40, 52, 54, 56, 57, 58, 59, 79, 83, 94, 137, 139 and 143 are also considered imprecatory. As a sample, Psalm 69:24 states toward God, "Pour out Your indignation on them, and let Your burning anger overtake them."
Jeremiah 18 was written in the imprecatory style. Let's see the context:
18 They said, “Come, let’s make plans against Jeremiah; for the teaching of the law by the priest will not cease, nor will counsel from the wise, nor the word from the prophets. So come, let’s attack him with our tongues and pay no attention to anything he says.”
19 Listen to me, Lord;
Jeremiah was in a defensive mode and solicit God's help.
Is Jeremiah speaking from the mouth of the Lord?
No, not really. He was being defensive here.
hear what my accusers are saying!
Jeremiah targeted his accusers only, not all the Jews.
20 Should good be repaid with evil?
Yet they have dug a pit for me.
Remember that I stood before you
and spoke in their behalf
to turn your wrath away from them.
Jeremiah had done them good before.
21 So give their children over to famine;
hand them over to the power of the sword.
Let their wives be made childless and widows;
let their men be put to death,
their young men slain by the sword in battle.
Why is Jeremiah so mean in Jeremiah 18:21?
He wasn't really being mean. He was being defensive and imprecatory.