Kostovic, the failed wizard and famously inept alchemist, discovered the Elixir of Magic by accident as the result of one of his many laboratory accidents. The accident went something like this:
The alchemists had long known how to replicate existing potions, without all the spells and incantations normally required. This is virtually identical to the original creation process (requiring all the proper ingredients prepared in the correct manner) but uses a "seeding dose" to replace the spells. The yield is not particularly high (say 1d4 doses if successful, burnt eyebrows if not), but it is sufficient to feed a steady market for the more common potions (i.e. those that produce an easily marketable effect, do not require exotic or arcane ingredients, and are reasonable safe the make).
Kostovic had devised a modified version of this method using minor cantrips (the only magics he was ever able to master) to boost the yield. This is a little better, not much, just a little (say 2d3 doses if successful).
Whilst using this method to replicate a standard magical potion (any type, whatever fits your campaign) he mispronounced the wording of the cantrip. However instead of blowing up in his face (the normal result of such a mistake), a new and unique magical potion was formed Kostovic’s Elixir of Magic.
Kostovic is unable to repeat the mistake (he simply can’t remember exactly what he said), but that doesn’t matter because as long as he has a seeding dose he can replicate as much as he needs. The elixir is therefore unique in being the only potion for which there is no original formula.
The elixir bestows upon the imbiber the ability to cast a few (say 1d6) spells selected either randomly or by the GM. In theory these can be anything the GM will allow, but it works best if they relatively low powered (minor cantrips or equivalent).
The imbiber instantly knows exactly how to cast the spells and what, if any, props or consumables are required to do so. He will of course need to obtain these items before he can cast any of the spells.
The spells remain in his memory for a limited period of time (say one week) or until cast, after which they are forgotten. (Note to GMs: This always happens, even if it is inconsistent with the magic system in use the elixir CANNOT bestow permanent spell casting ability.)
The elixir is extremely addictive.
One week after the elixir is taken the craving begins and the user must now consume another dose. If he has not done so with one day he must make a resistance roll/save/whatever against the potion (treat as poison), if this fails he suffers loss of character stats (Constitution, Health, or similar). This repeats once per day until another dose is taken. (Note to GMs: Do NOT make this simple hit point damage you can’t get around this with simple healing spells.)
When a new dose is taken the process starts all over again. (Note to GMs: If you are felling VERY kind you MIGHT allow lost character stats to be returned, but I wouldn’t recommend this.)