Cooks come to Bouchon Beverly Hills after working at famous kitchens all over the world. Bread baker Javier Medina, who is responsible for everything from those crisp yet chewy baguettes to the tender hamburger buns, took a different route.

The kitchens where he worked are largely unknown, located in state prisons where he was serving four stints for armed robbery, dealing drugs and other crimes.

Medina is a product of an unusual partnership between the restaurant, a fine-dining spot with a popular bakery that is part of chef Thomas Keller’s group, and Homeboy Industries, an organization that works to give second chances to those just out of prison and to former gang members who want to change their lives.

Cooking is a big part of Homeboy’s operation, including a bakery, a cafe, a catering business (Homegirl Cafe and Catering) and a facility that produces tortilla strips and salsas that are sold at local supermarkets.

For the last three years, a few of its best kitchen workers have been selected by Arlin Crane, Homeboy Industries’ director of food and beverage, and her staff for four-month “stages,” or internships, at Bouchon.

Medina started at Bouchon as one of those interns and proved to be such a good worker that he is now a full-time member of the kitchen staff. Among the seven others who finished the program is Laneshia Allen, who earned a full-time spot at Bouchon’s raw bar, where she opens oysters and serves shellfish. Other former Bouchon interns are back working in management at Homeboy, such as Alisha Ruiz, who runs the Homegirl Cafe commissary at Culver Studios.

Medina, 39, said that he first joined a gang in his hometown, El Monte, at age 10 and that he lived that life until about three years ago. That’s when he had an unlikely epiphany.

He said that he was robbing a man on the street and that the victim begged him to leave $20 so he could find his way home. “Something happened to me,” Medina says. “I broke down and started crying. I told him I was sorry, I didn’t know why I do this. I gave him back his phone and his money and some of my own. I told him, ‘I don’t know what’s wrong with me. I just do stupid stuff.’

“The next day, I said, ‘That’s it. I’m done.’”

Of course, it wasn’t that simple. After a three-month wait, Medina was accepted into the Homeboy Industries program of drug rehabilitation, counseling and jobs training. “I don’t think they thought there was any hope for me,” he says. “I was 36 years old, and I’d done so much time. I was set in my ways, and they thought I couldn’t change. But nobody was going to tell me that I couldn’t.”

Medina began working in the Homeboy Cafe bakery near Chinatown, where he found he had an aptitude for baking and where his work earned the respect of his bosses. So much so that he was tapped for an internship at Bouchon. Tapped repeatedly, it turned out.

While most cooks beg for an opportunity to work at one of Keller’s restaurants, Medina had to be convinced by the Homeboy staff. After all, it was in Beverly Hills, a place he had never even visited.

“I turned it down, like, 20 times; I was afraid of change,” Medina says. “I told them, ‘I’m not going over there with all those snobby people.’”

Finally, he was convinced, but he told his Homeboy supervisor that he’d return the next day if he didn’t care for the new gig. “But when I got here, I started getting to know people, and I noticed that everybody was cool. Nobody was dissing me, and it felt good.”

Bouchon executive chef David Hands says it’s tricky to negotiate the fine line between helping workers from challenging backgrounds and maintaining the strict culture at Keller’s restaurants, where standards are high and the atmosphere can seem more like an elite military unit than a kitchen.

“When someone comes out of Homeboy and comes here, they have to want to fit in,” Hands says. “It doesn’t happen overnight. There are lots of struggles, lots of second and third chances.

“That’s the hardest part for me. I feel like it’s a personal loss when you’ve tried everything and you’ve gone every which way and sometimes it just doesn’t work out.”

But success stories such as Medina’s far outweigh the failures, Hands says.

“It kind of opens up that cooking is not the be-all and end-all; there’s a lot more to life,” Hands says. “I’m absolutely 100 percent dedicated to cooking and want to give my best and all of that. But at the same time, this is actually changing lives. That’s really something.”

BOUCHON TLCS

50 minutes, plus chilling and warming times for the dough. Makes 6 to 12 cookies, depending on size

1 cup plus 1 1/2 tablespoons (153 grams) flour

1/2 tsp. baking soda

3/8 tsp. ground cinnamon

Heaping 3/4 cup (138 grams) granulated sugar

1/4 cup plus 1 1/2 tablespoons (75 grams) dark brown sugar

7 1/2 oz. (212 grams, or a scant 2 sticks) butter at room temperature

1/2 vanilla bean, split lengthwise

3 Tbsp. plus 1 tsp. (52 grams, or about 1 large) eggs

1 3/4 cups (134 grams) rolled oats

1 cup plus 2 Tbsp. (134 grams) coarsely chopped pecans

1. Place the flour in a medium bowl, sift in the baking soda and cinnamon and whisk together. Whisk together the sugars in a small bowl, breaking up any lumps.

2. Place the butter in the bowl of a stand mixer fitted with the paddle attachment. Turn to medium-low speed and cream the butter until it has the consistency of mayonnaise and holds a peak when the paddle is lifted. Add the sugars and mix until fluffy, 3 to 4 minutes. Scrape down the sides and bottom of the bowl. Scrape the seeds from the vanilla bean, add them to the butter mixture and mix on low speed to distribute the seeds evenly, stopping to break up any larger pieces.

3. Add the eggs and mix on low speed until just combined, 15 to 30 seconds. Scrape down the bowl again. The mixture may look broken, but that is fine (overwhipping the eggs could cause the cookies to expand too much during baking and then deflate).

4. Add the flour mixture in two additions, mixing on low speed after each addition until just combined, 15 to 30 seconds. Scrape the bottom of the bowl to incorporate any dry ingredients that have settled there. Add the oats and mix just to combine, then add the pecans (these may need to be mixed in by hand as the dough will be thick). Refrigerate the dough for 30 minutes.

5. Position the racks in the upper and lower thirds of the oven and heat the oven to 325 degrees. Line two cookie sheets with silicone mats or parchment paper.

6. Divide the dough into 6 equal portions, about 145 grams each (see note below for baking smaller cookies). Roll each one into a ball between the palms of your hands. The cookies will spread while baking and are very large; bake only 3 on each pan. Bring the dough to room temperature before baking.

7. Bake until golden brown, 18 to 20 minutes in a conventional oven, 14 to 16 minutes in a convection oven, reversing the positions of the pans halfway through baking. Set the pans on a cooling rack and cool completely.

8. The cookies are best the day they are baked, but they can be stored in a covered container for up to 3 days.

Note: Adapted from “Bouchon Bakery” by Thomas Keller and Sebastien Rouxel. The recipe requires the use of a scale and stand mixer. For smaller cookies, divide the dough into 12 equal portions and bake 17 to 19 minutes in a standard oven or 13 to 15 minutes in a convection oven. This recipe was developed to please Keller’s partner Laura Cunningham, who was always picking the dried fruit out of oatmeal cookies.