Tesla has signed a preliminary agreement with China's Tianjin Lishen to supply batteries for its new Shanghai car factory, as it aims to cut its reliance on Japan's Panasonic, two sources with direct knowledge of the matter said.

The companies had yet to reach a decision on how large an order the U.S. electric car company would place, and Lishen was still working out what battery cell size Tesla would require, one of the sources said.

While Panasonic is currently Tesla's exclusive battery cell supplier, Tesla Chief Executive Elon Musk said in November the U.S. company would manufacture all its battery modules and packs at the Shanghai factory and planned to diversify its sources.

"Cell production will be sourced locally, most likely from several companies (incl Pana), in order to meet demand in a timely manner," Musk said in a tweet in November.

Other battery makers in the running for contracts could include Contemporary Amperex Technology and LG Chem.

Tesla broke ground on the $2 billion so-called Gigafactory, its first in China, earlier this month and plans to begin making Model 3 electric vehicles (EV) there by the end of the year.