Quality control is important for any baking operation but takes on heightened urgency when using an ingredient that costs more than $1,000 a lb.

The expense of one principal ingredient was among several challenges shared by executives of Sweet Grass Kitchen, a Denver-based baker of cannabis-infused sweet goods. In a presentation Sept. 7 about baking and infusing cannabis into food, Jesse Burns, sales and marketing director, and Lauren Finesilver, executive chef and director of production, spoke as part of IBIEducate.  The company specializes in T.H.C. rather than C.B.D. products.

Cannabis accounts for 85% to 90% of input costs at Sweet Grass.

“It can be very expensive to mess up a batch,” Ms. Finesilver said.

In Colorado, cannabis is legal in all forms (by contrast, in Canada it is legal nationally, but edibles are not).

“It allowed Colorado to be an experiment for business in all categories,” Mr. Burns said, noting flower (for smoking), concentrates, edibles, drinks and tinctures.

“There are many legalization movements in many states around the country and many countries around the world,” he said. “Colorado has been a leading indicator for what happens in those other markets. When you see what happens with edibles or baked goods in Colorado, those similar trends are happening in California, Massachusetts, Michigan and other emerging markets.”

The company processes cannabis in 40-lb batches, baking it in a Revent oven and mixing it and boiling it with butter in a decarboxylation process necessary to activate the psychoactive qualities of tetrahydrocannabinolic acid, converting it into T.H.C. A small amount of decarboxylation occurs when cannabis flowers are baked directly into cookies and brownies, but much of the plant’s potency is lost, Ms. Finesilver said.

Sweet Grass’ process, which includes cooking cannabis flowers with butter, results in a highly concentrated green butter called cannabutter that is incorporated into its batters in precise quantities to accurately dose the finished products.

Cannabutter gives provides the taste of T.H.C., but the flavor “should not dominate or turn the cookies green,” Ms. Finesilver said.

Sweet Grass is a vertically integrated bakery. Production of cannabis for its products helps protect the company from wide swings in what Mr. Burns said has become a commoditized market in Colorado.

 “When we started in 2009, cannabis was upwards of $4,000 per lb,” he said. “The price fell as low as $400, and last week it shot up to about $1,500. There are a lot of businesses that built their revenue plans on a set price of T.H.C. or cannabis. They aren’t in business any longer. Be sure to build that flexibility into your process.”

Mr. Burns said the company’s cannabis production was adequate to cover its needs for the first half of 2019, but variability of yields and growth of demand for its finished products may require Sweet Grass to purchase from outside suppliers later in the year.

A less-expensive alternative to cannabutter, cannabis-infused butter is cannabis extraction.

“It’s much more concentrated, has a consistency like honey and is really sticky, and it can be difficult to get a uniform mixture throughout the baking process,” Ms. Finesilver said. “So, we use creaming, which is a pretty standard cookie mixing method. Cannabutter is also easier on the digestion and has a better flavor overall.”

Homogeneity also is of heightened importance when baking with cannabis, Ms. Finesilver said. Sweet Grass’ recreational products contain 10 mg T.H.C. per cookie (100 mg for medicinal), and it must be distributed evenly through each product.

“We’re essentially selling mind-altering cookies,” Ms. Finesilver said. “If a cookie is cut into four equal pieces, each one needs to contain 2.5 mg.”

The need for precise homogeneity makes it difficult to make products with large mix-in ingredients, Mr. Burns said. As a result, products such as rice-cereal treats are difficult to produce to the company’s standards.

If a batch of cookies varies in T.H.C. content plus or minus 15%, the entire batch must be destroyed, on camera, Ms. Finesilver said.

Other challenges identified by Ms. Finesilver included finding a dependable workforce.

“We look for professionally minded employees instead of T.H.C.-minded employees,” she said. “We have a zero-tolerance rule. No one is allowed to be under the influence at work.”

While banks cannot do business with cannabis-related companies, the state of Colorado allows credit unions to provide certain banking services, including checking accounts and payroll, to the industry. But cannabis companies are not able to secure business loans.

Sweet Grass works with an external lab to ensure quality control. In addition to testing for T.H.C. levels (in the cannabis, the cannabutter and the finished product), labs test for microbial and pesticide contamination.

Mr. Burns explained that the drug was legal until the 1930s, when it was outlawed except for medicinal purposes. The federal government banned marijuana completely in the 1970s, but states began legalizing again for medical purposes in the late 1990s and early 2000s. In 2014, Colorado became the first state to legalize marijuana for medicinal purposes. Currently, it is legal in 11 states for recreational use and 33 for medicinal.

Sweet Grass was established in 2009 when medical marijuana was approved in Colorado and introduced products for the recreational market in 2014. The company’s products include cookies, brownies, mints and fruit snacks. More recently the company has introduced baked foods containing C.B.D.

Its cannabis-infused cookies sell in packages of 10 for between $23 and $30 per package.

“It’s a high-margin item,” Mr. Burns said.