(Reuters) - JPMorgan Chase & Co JPM.N is in talks about leading Lyft Inc's upcoming initial public offering as an underwriter, after rivals Goldman Sachs Group Inc GS.N and Morgan Stanley MS.N decided not to pursue such a role out of loyalty to another IPO hopeful, Lyft's larger competitor Uber Technologies Inc, according to people familiar with the matter.

The move illustrates the calculations that often inform the pursuit of such mandates by the world’s biggest investment banks. Goldman Sachs and Morgan Stanley have helped ride-sharing company Uber raise money in the past, and are in pole position to secure top roles in its IPO, the sources said.

Reuters first reported last year that Lyft was seeking to hire an IPO adviser that would help it select underwriters and coordinate the process.

Since then, Lyft has hired IPO advisory firm Class V Group LLC, and is eyeing a stock market flotation sometime in 2019, according to the sources. Uber has also said it is aiming for an IPO in 2019, though it is further behind in its preparations and is not yet seeking to hire underwriters.

Several other investment banks are expected to join JPMorgan as underwriters for Lyft’s IPO. There is no certainty the bank will secure the coveted “lead left” underwriting position, the sources said.

Lyft plans to interview investment banks next month as it puts together its roster of IPO underwriters, the sources added, cautioning that no roles have formally been awarded.

The sources asked not to be identified because the matter is confidential. Lyft, JPMorgan, Goldman Sachs, Morgan Stanley and Class V Group all declined to comment, while Uber did not respond to a request for comment.

Slideshow ( 2 images )

Lyft’s and Uber’s IPOs will test investor tolerance for lack of profitability when it comes to iconic technology unicorns. Both companies have taken hits in their bottom lines in order to attract drivers and enter new markets, although they have made strides in recent years in narrowing their losses.

Like Uber, Lyft offers an app that lets passengers request rides on their smartphones. It was founded in 2012 by technology entrepreneurs John Zimmer and Logan Green, three years after Uber.

Lyft raised $600 million in its most recent funding round in June, led by Fidelity Management, doubling its valuation to $15.1 billion in little over a year. It operates in roughly the same number of U.S. cities as Uber, as well as in Toronto, Canada.

Investors in Lyft, which has 35 percent market share in the United States, include AllianceBernstein, Baillie Gifford, and KKR & Co Inc KKR.N.

Uber, under the leadership of Dara Khosrowshahi, who became chief executive a year ago, has juggled investing in new markets while retreating from others, where it was losing millions of dollars. It is building up services like food delivery and freight hauling as it seeks new revenue, and possibly a path to profitability, outside its core business.

Last month, Toyota Motor Corp 7203.T agreed to invest $500 million in Uber to jointly work on developing self-driving cars. The investment values Uber at $76 billion, a step up from the $72 billion valuation Uber received in a deal with Alphabet Inc GOOGL.O self-driving unit Waymo this year.