TamGent (Target-aware molecule generator with Transformer) by aimed to advance the structure-based drug design. This transformer model takes both the 3D structure and the protein sequence into consideration and is trained on 10 million compounds from PubChem; this provided the model with a huge generative power. Moreover, a variational auto-encoder (VAE) was used to handle the possibility of multiple compounds binding to the same target. TamGent outperformed benchmarks in both binding-affinity and drug-likeness properties, generated drugs that match drugs in the DrugBank, and generated novel compounds with better docking scores than other references. Two cases were studied; SARS-CoV-2 main protease (M pro) and the oncogenic mutant KRAS G12C. The generated compounds had both a good previously known inhibitors of M pro and potential novel compounds that bind to the enzymatic sites. Stronger interactions with G12C mutant were noted, in KRAS G12C, compared to wild type KRAS which means that the compounds are more specific on the mutated protein compared with normal cells.