g4fu
raw JSON → 10.3.2.4 verified Sat May 09 auth: no python
Fork of the gpt4free repository providing a collection of powerful language models for educational purposes only. Current version 10.3.2.4, with rapid releases and occasional yanked versions.
pip install g4fu Common errors
error ImportError: cannot import name 'Client' from 'g4fu' ↓
cause Outdated version or incorrect import path.
fix
Update g4fu to >=10.3.2.4 and use 'from g4fu import Client'.
error ModuleNotFoundError: No module named 'g4fu' ↓
cause Package not installed.
fix
Install with 'pip install g4fu'.
Warnings
gotcha The package is a fork and may have breaking changes from the original gpt4free. Always pin your version. ↓
fix Use g4fu==10.3.2.4 in your requirements.
breaking Version 10.3.2.2 was yanked due to module loading issues. Avoid using that version. ↓
fix Upgrade to 10.3.2.4 or later.
deprecated The package is intended for educational purposes only and may be removed or changed without notice. ↓
fix Do not rely on it in production.
Imports
- Client wrong
import g4fucorrectfrom g4fu import Client - Completion wrong
import g4fu.Completioncorrectfrom g4fu import Completion
Quickstart
from g4fu import Client
client = Client(api_key=os.environ.get('G4FU_API_KEY', ''))
response = client.chat.completions.create(
model='gpt-4',
messages=[{'role': 'user', 'content': 'Hello!'}]
)
print(response.choices[0].message.content)