Clever Boy!: Space Station Rat by Michael J. Daley. Holiday House/New York, 2005.
Jeff is bored on the space station. Things have gone wrogn and his Dad, instead of helping him, is occupied helping his mother, a Solar Phycisist.
Rat on the other hand has no time to be bored. She is hungry and lonely, and the hunger comes first. She escaped from a research facility, lost her tools in the process and somehow took a wrong turning. Now she is trapped on the space station. There is no food--only the boy is messy enough to leave left overs--and after exploring the station she realises she was lucky to survive the trip up.
Watching the boy, Rat learns to get food from the machines and it is this that almost gets her caught. The boy is so excited he askss to join the hunt, only at the last moment does he realist that this is a living, breathing person the robots are trying to kill. He saves Rat, smuggles her into his room and defends her from all comers.
The book ends with Rat trying to teach him sign language and Jeff working out how he can keep her secret for the two weeks before going back to Earth.
Not once does the boy or the author hint that Rat's future is as a pet rat. She is an independent person and the boy is her friend.