A codefendant in the federal witness-tampering trial of convicted drug trafficker Anthony Grandison was stabbed several times in Baltimore City Jail hours before he was to go to court.

Jail officials said they do not know the attacker or the motive in the assault on Rodney Kelly, 19, one of three codefendants with Grandison. Officials said he was stabbed about 7:30 a.m. Thursday, just before U.S. deputy marshals came to take him to federal court. Jury selection, which had begun earlier this week in the trial, was suspended by trial Judge Herbert F. Murray until Monday. Kelly was in stable condition today at City Hospital.

Grandison is charged with masterminding from his jailhouse cell the slaying of two suburban Baltimore motel employes who were potential witnesses against Grandison in a drug distribution case. Federal prosecutors have said in court that Grandison arranged to pay $9,000 to Vernon L. Evans Jr. to gun down the employes and that Kelly and a fourth codefendant, Janet P. Moore, helped in the arrangement.

All four are charged in federal court with witness-tampering and conspiracy to violate the civil rights of the witnesses. The four are also charged in Baltimore County Circuit Court with murder and face trial there this fall.