OK, per code a vent needs to come off the top of a drain line and no more than 45 degrees off vertical. But in my first sketch, the 3" oversized horizontal line from the stack would actually function as a vent. But I was really thinking the line from the toilet to the branch line woukd be as short as possible. Your current fabrication has a section of pipe before the branch connection from the toilet. But now knowing the toilet is very close to the grade beam, going with your sketch above makes the "bad" horizontal run of the vent section significantly shorter therefore MUCH better. Now let me say that there is some discussion on upstream venting of a toilet. So, at the risk of further confusion, here is another approach that looks feasible as it seems like the drains are pretty far below the top of the grade beam, and this approach would really properly vent the toilet in strict accordance with any code.
First of all, the toilet line can be 3" all the way to the 4" main. And as the toilet is the only thing flowing into that line per your sketch, the higher velocity of the 3" line would help keep the line clean with today's low flush toilets.
Now let's start at the line under the toilet. Put a regular 90 on the line pointing directly up to where the toilet flange will be. Put a 3x3x3 wye, or 4x4x3 wye if you stay with the 4" line to the 4" main, and point the wye parallel with the grade beam. Install a long radius 90 on the wye going into the grade beam at a 45-degree angling up, and then a 45 fitting to get the vent stack vertical and centered in the grade beam, or wherever in the grade beam you want the vent to come up. If the dimensions are really tight, using street fittings (90s, wyes, 45s) will save you a few inches over regular fittings and pipe. And if the long radius 90 angling up at 45 degrees isn't possible, you can get a 60-degree fitting and angle the long radius 90 to 30 degrees up.
I hope this helps and doesn't cause you too much redo.