David Millar's plan for 2014, his final season as a professional, is to target stage wins in the Tour de France and Vuelta a España and a gold medal in the Commonwealth Games road race in Glasgow. "That would be my dream year," said Millar, who also intends to be a protagonist in the spring Classics and to close his career by captaining the Great Britain team at next year's road race world championship.

Provisionally, Millar – who will be 37 by the time next season starts – plans to race a full early season with the Mallorca challenge, Tirreno-Adriatico, Milan-San Remo and the Belgian Classics, before taking a break then building to the Tour de France, Commonwealth Games and Vuelta. Then he will call time on an 18-year career which has included stage wins and leader's jerseys at all three major Tours and winning the time trial at the Commonwealth Games in Delhi in 2010, not to mention his fall from grace over doping in 2004 and his reinvention as the peloton's leading anti-doping campaigner.

Millar's decision to make 2014 his final season was a gradual one taken over this year. "I love what I do. It's very scary for me to decide to stop doing it when I could keep going," he says. "It will be like leaving school, but a school I've been in for 20 years. That's all my adult life, although you could arguably say the first 10 years were my adolescence."

The arrival of his sons Archie and Harvey have been the reason, "100 per cent", as is so often the case. "You need to really love it, and there were moments this year when I didn't love it. In December 2012 I was thinking of continuing until I was 39 or 40, but this year my second son was born, I left for the Giro the day after, had a horrific two weeks. I used to read about guys retiring to spend more time with their families and think – why would that affect anything? I understand now. I get one chance to be a dad and spend time with my sons when they are small. I realised I was missing a lot of that."

Millar has also become increasingly aware of the demands his profession makes on his wife, Nicole. "She can only be so stoic. I ask a huge amount of her, and it was getting to the point where the relationship is unbalanced. I go off and live my dream, get feted, going to dinner parties, I'm the one everyone wants to talk about, she disappears into the background, looks after our two sons. I don't think that's fair."

He is uncertain what career path he will follow when he hangs up his wheels, although he hopes that working for Garmin, the team he helped to found, ideally with young riders, will be part of the picture. Media work would appear to be another avenue, given that he has spent much of the period since the end of the racing season collaborating with Stephen Frears on a biopic of Lance Armstrong.

"It's a mad experience. It's something people who are into films would cut their arm off for," says Millar. "I get to be Stephen Frears's right hand on set, liaise with him, discuss things with the scriptwriter; I'm literally hanging out with the executives on a major motion picture, having a voice and being respected. I've learned so much. It's another world, mightily impressive. We always talk about the pro cycling teams, how amazing they are, then you go into something like that and it's 'wow' – the level of organisation, the structure, how they live. They're on the road more than we are. It's a nice wake-up."

Millar is also involved in another film, a documentary directed by the Bafta-winning Scottish producer Finlay Pretsell, who made the acclaimed short film Standing Start with the sprinter Craig MacLean. "He said he would like to do something similar in road cycling; nothing exists today about what modern road racing is really like. It's not a fly on the wall cliched documentary story of my life, but it takes me as a pro bike racer and immerses the viewer in that world. Hopefully we can use cameras on bikes, maybe cool, crazy data on screen, to give a visceral, personal experience. He has a different eye, we want to make a beautiful film which will be a lovely goodbye and thank you to cycling."

Shooting will start next year at the Tirreno-Adriatico, and the film should be released about 12 months from now. Millar hopes it will provide a counterpoint to the current focus on the fall-out from the Lance Armstrong doping scandal, saying: "Everything is the same melodramatic soap opera now and racing is on the periphery – if we can create something that people watch and think wow bike racing is pretty amazing and get back to the racing, I'm one of the few that can encapsulate that because my story illustrates the way the sport went in the last 15 years. I don't have to reveal or explain anything so we can look at the racing."