An important first step in stent occlusion is the formation of a bacterial biofilm. This is followed by deposition of granules similar to that found in brown pigment stones. Previous in vitro models for studying occlusion have used synthetic biles without bilirubin or pooled human bile, which is limited in supply. Our aim was to develop a new in vitro model of stent occlusion with porcine gallbladder bile and then, with the model, assess whether ampicillin-sulbactam can prevent biofilm formation and thus occlusion. Sterile porcine gallbladder bile was contaminated with Escherichia coli then divided into eight reservoirs, four of which then received ampicillin-sulbactam. The bile was then circulated through 10F polyethylene stents. Bile was changed weekly for 8 weeks. In the stents that were untreated, biofilm and sludge were seen in all four, whereas the four ampicillin-sulbactam-treated stents had no biofilm when viewed by electron microscopy. Furthermore, the levels of calcium, cholesterol, and bilirubin in the reservoirs decreased significantly in the untreated bile as compared with the treated bile (p < 0.05). In this in vitro model, the losses of calcium, cholesterol, and bilirubin are likely caused by deposition of granules into the biofilm matrix. Ampicillin-sulbactam can prevent biofilm formation if used continuously.