Skip to main content

One Person, Three Months, RMB 30,000: How He Used Qoder to Turn the Messy Accounts of 10,000 Sheep into Code

Xixianji founder Zhang Lifei used Qoder to build five business systems on his own in just over three months, spending a little over RMB 30,000 on Token costs, improving feed-cost accounting efficiency roughly 50-fold, and reducing feed consumption by about 10%.

Back
Ningxia-based Xixianji has annual sales exceeding RMB 200 million and more than 10,000 Tan sheep on its farms. Yet every month, the company struggled to answer even a basic question: how much feed had the sheep actually eaten? Its founder, Zhang Lifei, is a veteran programmer who previously worked at Huawei and Ericsson. After Chinese New Year in 2026, he used spare moments in the evenings and on business trips to build five business systems with Alibaba’s Qoder in just over three months. Together, they cover farming, slaughtering, processing, finance, and e-commerce, with total Token costs of just over RMB 30,000. A little over two months after launch, feed-cost accounting efficiency had improved roughly 50-fold. Estimated sheep weights were within 10% of actual weights, with errors of only 1%–2% in some scenarios. Feed savings alone could amount to more than RMB 1 million a year. Follow Zhang’s camera for a closer look at the story of a sheep farmer in Ningxia and his partnership with Qoder.

“Every Morning, I Had No Idea Whether We Were Losing Money or Making It”

One evening in late July, in Gaoshawo Town, Yanchi County, Ningxia, Zhang Lifei sat beside a sheep pen, scrolling through his phone. On the screen was the livestock management system he had launched two months earlier. A number appeared: RMB 1 million. That was the monthly feed bill for his three farms. For more than 10,000 sheep, the annual total came to over RMB 12 million. Further down the screen, he could see the purchase price, consumption, protein content, and energy content of every type of feed. This was also where he first discovered that the three farms were still buying through different procurement channels. “It creates a sense of panic as a manager,” Zhang said. For the previous eleven years, he had faced a set of accounts that never quite added up. “Every morning, I had no idea whether we were losing money or making it. We relied entirely on trust. As long as nothing went seriously wrong, that was good enough.” As a partner and general manager of Xixianji, Zhang has spent eleven years in the Yanchi Tan sheep business. Xixianji is a regular supplier to Freshippo, Xiaoxiang Supermarket, Meituan, Oriental Selection, and JD.com’s direct-sales business. Its sales exceeded RMB 200 million in 2025, up nearly 40% year over year. From Harbin to Sanya, around 100 million people can order its Tan lamb and have it delivered within half an hour. Behind that success lies a less visible side of livestock farming: industry net profit margins are generally below 10%. Costs must be managed down to the smallest detail, yet more than half of them remain difficult to account for.

In a Nonstandard Industry, Everything Is a Black Box

Yanchi is China’s only pastoral county and is known as the “home of Tan sheep.” It has 175 species of natural forage plants, 115 of which can be used in traditional Chinese medicine. Its water is mildly alkaline and rich in minerals. Sheep raised on this pasture and water produce tender meat without a strong gamey smell, and their lamb has been served at state banquets on multiple occasions. But raising these sheep well and getting their meat onto tables in Beijing, Shanghai, and Guangzhou is harder than it sounds. To meet market standards, Tan sheep must reach around 36 kilograms within nine months, with meat that is tender but not overly fatty. That makes feeding especially demanding. Alfalfa, oat hay, Caragana shrubs, wild grasses, corn, soybean meal—a single sheep eats more than a dozen ingredients. Protein, energy, and crude fiber must remain in a dynamic balance. Protein is like a set of scales: too much wastes money and turns into fat; too little means insufficient lean growth. Feed formulas must also be adjusted weekly or even daily according to age, weight, and sex. The problem is that how much to feed, and how to feed it, depends entirely on the farm workers’ experience. Most frontline workers at Xixianji’s three farms are experienced hands over 50. Getting them to report daily quantities and formulas accurately is “basically impossible.” The sheep themselves make matters harder. These are live animals, not items that can be weighed every day. Catching them causes stress. Weighing several dozen in one session is already a major effort; sometimes a full day’s work yields measurements for only a handful. Zhang tried every approach he could think of: weighing on arrival, weighing before sale, sample weighing, and weighing a few more when the weather was good. Yet a spot check would often reveal that sheep had lost weight despite being fed. That meant the feed and labor already invested had been wasted, with “no way to tell what was happening along the way.” On one occasion, a worker who was upset and planning to quit simply scattered the feed carelessly, and an entire batch of sheep lost weight. In other cases, quality control would not report that “this batch is too fatty” until slaughter and cutting. Looking back over a three-month production cycle, the losses could run from hundreds of thousands to RMB 1 million or 2 million. Under the traditional approach, these problems “couldn’t be detected, and might never be detected.” Even year-end accounts could not explain what had gone wrong. As a former programmer, Zhang was used to working with data. Code changes leave records, tests produce results, and failures can be traced through logs. But from his first day raising sheep, he felt as though he had fallen into a black box where nothing could be clearly explained. A system that could manage all of this had been on his mind for eleven years.

“It Wasn’t That We Didn’t Want a System. We Couldn’t Afford One.”

Had he considered hiring someone to build it? Yes—more than once. With his programming background, Zhang knew exactly how expensive such a system could be. Traditional outsourcing would require at least a nine-person team working for three months, with a purchase price starting around RMB 1 million. Even another year of iteration might not make it genuinely usable. “The quotes were over a million yuan. To put it bluntly, we couldn’t get the systems to work for us—and even if we did, they wouldn’t solve the problem.” A friend in Shandong, whose business was larger than Zhang’s, had spent more than RMB 20 million on digitalization without achieving the intended results. Other local companies in Ningxia had also adopted information systems, only to find that they were “installed but unusable.” The reasons were much the same. Generic SaaS required the business to adapt to the system, rather than the system following the business. Employees with limited formal education struggled with complex interfaces and abandoned them after a few days. Every new requirement meant another contract and another development queue, consuming another month or two. The system became little more than a showpiece. Zhang understood this particularly well because he had come from large technology companies. He spent nearly a decade at Huawei and Ericsson. In his final year, he was sent to Ericsson’s headquarters in Sweden to work on an architecture migration involving six teams across five countries. With so many people and time zones, a single decision could take weeks. Every morning brought hundreds of unread emails, leaving him feeling powerless in the middle. “Rather than wait to be laid off in my forties, I might as well start something myself.” In August 2014, over a meal of lamb spine hot pot, he and his university classmate Zhang Xiao made a decision: “Let’s go home and build a Tan lamb brand.” After nine months of research, he returned to Ningxia and founded Xixianji in 2015. It began as an asset-light e-commerce business with a simple belief: “Contracts and standards can keep everything under control.” Reality soon proved otherwise. During its first Singles’ Day order for JD.com’s direct-sales business in 2016, just as 10,000 portions of lamb ribs were due for delivery, a partner factory suddenly said it could not supply the order, raised its prices, and demanded bundled purchases. “If we don’t control our own supply, we can be held hostage at any time.” Like Huawei being pushed to develop its own chips, Xixianji was forced to move upstream step by step. It assembled a production team in 2018, then opened a slaughtering and processing plant, and built its own farms in 2023. Today, the company processes around 100,000 Tan sheep a year: 30,000 are raised on its three farms, and the remaining 70,000 are sourced from other farmers. It is also developing a RMB 98 million ESG demonstration facility for the full Tan sheep production chain, scheduled to begin operations in June 2027. As its asset commitments grew and cash flow tightened, the need for a system became harder to ignore. It was simply still too expensive to make the change.

Taking a Chance on Qoder

In early 2026, Zhang discovered Qoder in a technical community. His instincts as a programmer told him an opportunity had arrived. Qoder is an AI coding tool from Alibaba. Rather than merely writing a few snippets, it acts as an assistant that can understand requirements, break them into tasks, write code, and debug it. Just as importantly for Zhang, it runs on cloud infrastructure in China, with code and data retained locally. His approach to choosing a tool was practical. Strong capabilities were only the starting point. Stable service and continued availability were what determined whether an enterprise production system could keep running over the long term. He had previously used Cursor and tried other tools. Some had too steep a learning curve, and he did not have time to start over. Others were capable but came from overseas providers whose models and services, he felt, “could be cut off at any moment.” For an agricultural business with no IT team, even an advanced tool becomes another problem if nobody can handle an outage. Taken together, these requirements made Qoder the best fit. His experience reinforced that choice: he eventually migrated almost all his previous projects to Qoder—around 90% of them. “I update to every new version as soon as it comes out. The experience is really smooth. Qoder has become a great partner throughout my digital development work. Communicating with it is even easier than communicating with professional technical staff,” Zhang said. “Each conversation is like another version of me, which is especially useful for intense, parallel development across multiple projects at night.” He got started after Chinese New Year. His days were occupied with production, construction, and coordination, so model building had to fit into gaps between tasks, business trips, and evenings. “You can’t expect other people to stay up all night with you. But AI can.”

Three Months, One Person, Five Systems

From January to the end of May that year, Zhang built five complete systems with Qoder, working alone on high-speed trains, on planes, and in hotel rooms in Ningxia and Shanghai:
  • Livestock management system: The most complex system, covering feed ratios, a nutrition and weight-gain model, weight estimation, and cost accounting.
  • Slaughter management system: Full-process data on meat yield, losses, and packaging as each sheep is cut into semi-finished and finished products.
  • Test report management system: Batch-level quality inspection data and traceability.
  • Media asset management center: Automatic updates to assets used by e-commerce stores.
  • Product assortment management and finance system: Procurement, invoices and receipts, online signatures via QR codes, and matching product grades.
His strategy was to start with the easier tasks. He first built the smaller slaughtering, testing, and media systems, each with fewer than 100,000 lines of code. Once they worked and he had gained confidence, he tackled the two most complex areas: livestock management and product assortment management. His first piece of advice to peers was: “Start with the most expensive, least transparent part of the business. Get it working first, then iterate.” The toughest challenge was the nutrition and weight-gain model. It had to answer a simple question: of the feed given each day, how much became lean meat, how much became fat, and how much was wasted? Sheep cannot explain what is happening, so the answer must be inferred from data and algorithms. But animal growth is continuous and gradual; today’s feed does not become tomorrow’s body weight overnight. Zhang collected industry research papers, national standards, and data from agricultural authorities, organized them into an algorithmic approach, and developed the model step by step with Qoder. With a science and engineering background but years away from mathematics, he discussed formulas with Qoder and kept debugging the gap between the model’s predicted growth and the sheep’s actual growth until the two were almost indistinguishable. He and Qoder spent three sleepless nights on that problem. Once the nutrition and weight-gain model was working, another challenge emerged: allocating feed consumption across days. After switching to large bins for free feeding, workers would add several hundred kilograms to a tonne of feed at once. The sheep might take three days or five days to finish it, making daily costs difficult to calculate. Zhang brought the problem to Qoder. The feed-allocation module was built that day and launched the next: it estimated how many days the feed would last, how much would be consumed each day, the resulting nutrition and weight gain, and when the bin would be empty. Next came transfers between farms. The three farms frequently helped one another out: Nanliang might have extra feed while Lizhuang was running short, so a batch would be moved over. Feed purchase prices changed daily. If a transfer was not recorded on the day it happened and was entered later, inserting the historical transaction meant recalculating both costs and weight gain. Zhang designed a solution with Qoder that evening and put it into use the following day. He became hooked on that speed. For complex modules, he sometimes prepared the framework in advance, left the computer running overnight while AI worked, and checked the results in the morning. As a manager, he switched freely between “IT engineer” and “boss”: when staff reported bugs, he was IT; when it was time to roll out a system, he was the boss. His design rule was that a new operation must replace at least one existing task, ideally several. It must never add extra work for employees.

Catching a Feed Imbalance Within a Week: Money Saved Is Money Earned

Not long after the system went live, Qoder helped expose a problem that could have cost hundreds of thousands to RMB 1 million or 2 million. A feed manufacturer had promoted a new product whose nutritional indicators looked balanced. Zhang followed the trial process and tested it for a week. Then the system’s predicted weight-gain curve suddenly became abnormal. A closer analysis revealed that the energy component of the new formula overlapped heavily with the corn already being fed. There was too much energy and not enough protein: fat was growing faster than expected, while lean growth fell short. In less than a week, the cause was traced, corn feeding was reduced, and the curve returned to normal. Previously, this kind of imbalance might not have been detected until quality control reported “this batch is too fatty” during slaughter and cutting several months later. It might never have been found at all. Looking back over the production cycle, a single incident could mean losses starting in the high hundreds of thousands of yuan, with year-end accounts still unable to explain what had happened. Now, the accounts are fully transparent. Since the system went live on May 31, feed-cost accounting efficiency has improved roughly 50-fold. Estimated sheep weights are within 10% of actual weights, with errors of only 1%–2% in some scenarios. Feed consumption has fallen by 10%. Against annual feed spending of more than RMB 12 million, that amounts to savings of over RMB 1 million a year. The finance manager put it more directly: “People who understand AI don’t understand sheep farming, and people who understand sheep farming don’t understand AI. Mr. Zhang understands both, so he was able to build software that actually fits our business.” Previously, several finance staff had to juggle multiple roles at month-end, manually enter data into Excel, and deal with cascading errors when a single number was wrong. Now, invoices and receipts are photographed, uploaded, and automatically recognized and entered. Procurement, farming, and finance teams sign online via QR codes, while slaughter records are automatically matched to product grades and prices. Instead of roughly averaging feed, labor, and overhead costs and settling the accounts only after the sheep were sold, the company can monitor the process as it happens. Yesterday’s feed input, feed allocation, projected growth, weight curves, and the number and estimated weights of sheep in each pen are all clearly traceable across the production chain. One person. Just over three months. Total Token costs of a little over RMB 30,000. That even includes the “tuition fees” he paid while learning through early mistakes.

Finally, Turning the Rules of a Nonstandard Industry into Software Is Affordable

More and more peers have approached Zhang for advice. After answering the same questions repeatedly, he distilled his experience into three lessons:
  1. The owner has to get involved personally. If the person who understands the business does not take part, there will always be a gap between the system and the business.
  2. Start with the most expensive, least transparent part of the business. Get it working first, then iterate.
  3. Don’t be afraid of a nonstandard industry. Nonstandard does not mean there are no rules. It means that, until now, nobody could afford to turn those rules into software.
“Now, that cost has come crashing down,” he said. He may be the first person in the Tan sheep industry to take this approach. He certainly will not be the last. Fellow farmers in Ningxia, Shandong, and Inner Mongolia, slaughterhouses, processing plants, fresh-food brands—any traditional business held back for decades by opaque accounts could be transformed by someone who understands the business working with an AI partner available around the clock. This is not just a story about one sheep or one person. It is a story about traditional industries across China being able, for the first time, to afford to turn experience into code. Zhang’s systems are still evolving rapidly. When the new RMB 98 million factory is completed, the entire production chain will need fully integrated digital management. The facility will use sensors that upload data automatically, rather than relying on manual records. He has already tested using Qoder to connect to sensors: give it the device’s interface documentation, and it can generate the integration code automatically. He also plans to involve Qoder directly in hardware development, creating feed-mixing equipment better suited to small and medium-sized farms. That would move the system from predicting outcomes and tracking results to directly participating in execution. These days, Zhang often walks through the sheep pens in worn cloth shoes, holding a carrot in one hand and his ROG laptop in the other. “I used to be a workhorse at a big internet company. Now I’m the programmer in the sheep pens,” he joked. “I’m staying up late either way—what difference does it make who I’m writing code for?” Except that this time, the accounts finally make sense.