The Rambam in the 14th perek of Hilchos Issurei Bi’ah rules that a Jew who acquires a non-Jewish slave from a non-Jew must convert him to Judaism in a manner similar to a ger tzedek (albeit the conversion does not result in the slave having full Jewish status, but rather the unique status of an eved kena’ani). The conversion requires the slave’s consent. If the slave does not consent, the Jew can keep him as a slave for twelve months, during which time he can attempt to persuade the slave to convert. If his efforts prove futile, at the end of the twelve months the Jew must sell the slave back to a non-Jew.
However, continues the Rambam, if as condition of the original purchase, the Jewish owner and the non-Jewish slave came to an agreement that slave would not undergo a full conversion (i.e., he would not undergo milah and tevilah), but would take upon himself the commitments of a ger toshav (which are, more or less, congruent with seven mitzvos bnei Noach), then the slave can serve the Jew in that capacity for as long as the arrangement continues.
This option does not appear in the Bavli.
The Ridbaz suggests that the source for the condition of ger toshav being an option is the Yerushalmi here. He explains in this manner a cryptic line in the Gemara that reads Eved toshav l’olam, ger v’toshav harei hu k’goy l’kol davar. The Ridbaz punctuates and explains the Gemara as follows: Eved toshav – if one acquired a non-Jewish slave on the condition that he be an eved toshav (i.e., a slave that has the status of a ger toshav) – l’olam – he may remain with the Jew indefinitely. Ger – but if no such condition was made, then the assumption is that the slave was acquired in the normal manner, which requires the slave to undergo the full conversion of a ger tzedek. In that case, if the slave refuses to convert – even if he subsequently agrees to undertake the commitments of a [ger] toshav – harei hu k’goy – he may not be kept by the Jew, and after twelve months reverts to being fully non-Jewish.