There are
conflicting reports about what is
happening in and around
Tripoli.
I'm not going to write about that. Assuming that the rebels remain united, then there are only a few ways that this will end.
First is a negotiated deal, where Gaddafi, his family and his inner circle are allowed to flee to a third nation, which will, in turn, promise not to extradite them. This would be the "golden prison" option, for likely Gadafi would be confined to a compound of some sort.
*
The second is a semi-frozen conflict, where the rebels are not strong enough to advance into and take the city, yet the loyalists are not able to reverse the rebels' gains. The rebels would infiltrate areas of Tripoli and stir up trouble for the loyalists, but without the ability to enter into heavy urban warfare. In essence, this would be 21st Century siege warfare. As in traditional siege warfare, the suffering would fall most on the civil population. The goal in this is to either force Gaddafi to flee or to spark an uprising among the lower ranks of the remnants of the Libyan military, who may not see a reason to die for Gaddafi.
The third is all-out urban warfare. This is probably the least likely to happen. Urban warfare is a brutal and bloody business; you don't need to be any sort of military scholar to know that. Whether the Battle of Monterrey, the Battle of Stalingrad, the Battle of Berlin or the Battle of Hue,
** taking a city by force requires a large, well-trained force and the ability to take a lot of casualties. Since a necessary tool for urban warfare is the hand grenade (and other explosives), civilian casualties will be very high.
I've not made any sort of serious study of the Libyan rebels. "Well-trained" and "heavily armed" do not seem to be appropriate adjectives, though. They've gained experience the hard way, they have been getting some on-the-fly training from various special forces and I do not mean to make light of their dedication. But they don't have heavy weapons (to any great degree) and they have no air support. I don't see NATO flying armed missions in support of urban warfare, as civilian casualties would be unavoidable and NATO is rather adverse to that.
Gaddafi also has a problem with arranging to flee: When word gets out to his troops that he is bailing out, they might decide that their best option is to present his head to the rebels as a surrender gift. Otherwise, they are left to face whatever retribution will be handed out to the loyalists by the victors. Historically, being on the losing side of a civil war is a bad place to be.
***
UPDATE:
It would seem that Gaddafi's army is less than interested in dying for a lost cause. So this may be over sooner rather than later.
________________________
* He'd probably not want to leave anyway for fear of assassination or rendition ("rendition" is when a national government engages in kidnapping).
** To cite a few examples. There have been plenty of others, particularly between the Soviets and the Germans in the Great Patriotic War.
*** The South got off very lightly in this regard, though you wouldn't know it to hear the kvetching that continues to this day.