A library for unlimited use of LLM through g4f, using a proxy
Project description
g4fp
This is a library for unlimited use of LLM through g4f, using a proxy
Installation:
pip install g4fp
Now you can pass debug (True/False) and proxy (FreeProxy object) values ​​to ClientProxy and AsyncClientProxy
Usage example (async):
import asyncio
from g4fp import AsyncClientProxy
async def main():
client = await AsyncClientProxy(debug=False, proxy=FreeProxy(timeout=5, rand=True))
messages = [
{"role": "user", "content": "Hello!"}
]
response = await client.chat.completions.create(
model="o1-mini",
messages=messages,
)
print(response.choices[0].message.content)
if __name__ == "__main__":
asyncio.run(main())
Usage example (sync):
from g4fp import ClientProxy
client = ClientProxy(debug=True)
messages = [
{"role": "user", "content": "Hello!"}
]
response = client.chat.completions.create(
model="o1-mini",
messages=messages,
)
print(response.choices[0].message.content)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
g4fp-1.1.2.tar.gz
(14.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
g4fp-1.1.2-py3-none-any.whl
(14.9 kB
view details)
File details
Details for the file g4fp-1.1.2.tar.gz.
File metadata
- Download URL: g4fp-1.1.2.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31e22201fa3161eb6d9967a1b06f328324737790814409f058a4781def55347b
|
|
| MD5 |
6135a2ed28ae73ef33dbe86612024edb
|
|
| BLAKE2b-256 |
6fe21f8900521eb244e7219c05116b1378f5b3726e29b7ea9600a53933edca2c
|
File details
Details for the file g4fp-1.1.2-py3-none-any.whl.
File metadata
- Download URL: g4fp-1.1.2-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e85bdb52c48802249dd29465681b56e7404c56b4a8d65bd60a5fb42fbe7279a0
|
|
| MD5 |
57746d018e6fc142e29a41bea93e978d
|
|
| BLAKE2b-256 |
4b795570bc623293d475e4e1029c7bcc6effdbe7e3d689c519c3d690a1671d07
|