As far back as 3e, clerics could gain power from a philosophy rather than a deity. Might even go back earlier, since I played a 2e specialty cleric that followed a philosophy (maybe my DM was just being nice, I don't recall).
In 2e you could get 1st and 2nd level spells on faith alone. After that you needed a deity.
Correction, it goes back to 1e where you get first and second level spells from education, training, and experience, not from them being granted by their deity or its servants or by their faith.
Each cleric must have his or her own deity, so when a new player opts to become a cleric (including a druid), you must inform them as to which deities exist in your campaign milieu and allow the individual to select which one of them he or she will serve. This will not necessarily establish the alignment of the cleric, so at the same time the cleric player character should also state his or her ethos (not necessarily to the other players). It is then assumed that prior to becoming a first level cleric, the player character received a course of instruction, served a novitiate, and has thoroughly read and committed to memory the teachings of and prayers to his or her chosen deity, so that the character is dedicated to this deity and is able to perform as a cleric thereof.
It is this background which enables the cleric character to use first level spells.
Furthermore, continued service and activity on behalf of the player character’s deity empower him or her to use second level spells as well, but thereafter another agency must be called upon.
Cleric spells of third, fourth, and fifth level are obtained through the aid of supernatural servants of the cleric’s deity. That is, through meditation and prayer, the cleric’s needs are understood and the proper spells are given to him or her by the minions of the deity.
Cleric spells of sixth and seventh level are granted by direct communication from the deity itself. There is no intermediary in this case, and the cleric has a direct channel to the deity, from whom he or she receives the special power to cast the given spells of these levels.
Lesser clerics, then, draw only upon their education, training, and experience to gain spells, just as higher clerics do when they renew their first and second level spells. In order to gain third, fourth, and fifth level spells, however, higher clerics must reach intermediaries of their respective deities in order to have these powers bestowed upon them from the plane of their deity. When clerics become very great, they must petition their deity personally in order to receive the powerful words which enable the casting of sixth and seventh level cleric spells. It is obvious, therefore, that
clerics wishing to use third or higher level spells must be in good standing.
So 4th level clerics who picked a god and went through the education but have no faith and are not in good standing with their god can still cast their full complement of spells.
In 2e Complete Book of Priests you have full on non-deity philosophies and forces that spellcasting priests can follow. Legends and Lore has specialty priests for followers of Confucius and Lao Tzu.
"Priests dedicated to Lao Tzu
or Taoism must preside over a wide range of ceremonies."