The circuit in the first link below is a driver, but also provides current regulation, so acts as the ballast for the leds. This means the current used by the leds is independent of the supply voltage, so long as it is sufficient. A typical value of R would be 47 ohms, which allows almost 15mA.
When the input is high, the transistor connected to the leds is turned on. Current flows through the battery, leds, collector emitter path, and then R. At around 15mA the voltage across R is 0.7V, just sufficient to start turning the second transistor on. This robs some of the base current, which tends to prevent the current increasing further, so equilibrium is established when 15mA flows.
The second link has info about using leds, and shows a simple driver, where R is the ballast. See the 'transistor driver circuit'. TR1 can be a BC547 or 2N2222 etc (NPN with 100mA collector current or a little more). The value of Rb can be 4.7K. The ballast resistor R takes up the difference between Vbattery (Vcc) and the led forward voltage Vf, at the desired current. R = (V_cc - V_led) / I_led. I_led is 0.015A. Leds can be in series with a single ballast resistor. In parallel, each series string requires a ballast resistor to suit. This could be around 470 ohms for a red led and a 9V battery or 390 ohms for a blue or white led.. With 9V there can only be 3 red leds or 1 or 2 blue or white leds in series.