Today the Hebrew word "leviathan" is translated as a whale. But the leviathan of the Tanach seems to be some kind of sea creature. See Job 41:1-34. Tehillim 74 there is an implication that G-d served the meat of the leviathan to the Jews in the Midbar. Isaiah 27:1 describes it as a "tortuous serpent" that G-d will "punish." The Gemara in Bava Basra 74b says that G-d will serve the meat of the leviathan to the righteous. What is the prevailing opinion that best describes the leviathan, taking in these and other treatments of the creature in our texts?
Rashi brings the description of the Leviathan as unique sea creature that was not allowed to reproduce. There are many opinions that the meal served to the righteous will be a physical meal, so we are talking about a unique kind of fish that would not normally be seen.
The Baal HaTanya describes the idea of the Leviathan (and the Shor HaBar) metaphorically. The Leviathan represents the righteous, like Rabbi Shimon Bar Yochai and the Arizal (those are the two examples that he brings) that serve G-d primarily in their intentions and connection to the underlying spirituality, and thus with less emphasis on accomplishing physical Mitzvos. So Rabbi Shimon Bar Yochai didn't fulfill many physical Mitzvos 13 years in the cave, but was still accomplishing his purpose - kind of like an angel but actually in the world instead of above it - so a "fish out of water" so to speak.
The other type of service of the righteous is the Shor HaBar [that has an English term for it, but I don't remember what it is]. There the emphasis in actual fulfillment of Mitzvos in the world. He goes on to explain the relationship between the two types, and how the idea that in the future the Leviathan will Shecht the Shor HaBar is related to this.