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 (bool) ClientProxy and AsyncClientProxy
Usage example (async):
import asyncio
from fp.fp import FreeProxy
from g4fp import AsyncClientProxy
async def main():
client = await AsyncClientProxy(debug=False)
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.9.tar.gz
(14.7 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.9-py3-none-any.whl
(14.8 kB
view details)
File details
Details for the file g4fp-1.1.9.tar.gz.
File metadata
- Download URL: g4fp-1.1.9.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
311c4e43aa896624a65ec5760487317ee887d2ad8f20cf8fde2a0ac0e77feb49
|
|
| MD5 |
536bcb1f08e9c09f762e0ace7a6f0bcb
|
|
| BLAKE2b-256 |
348e9f246d0d32b3c600b3b396a22fc0829ba1370e6c5197e8f5eb2029809bc2
|
File details
Details for the file g4fp-1.1.9-py3-none-any.whl.
File metadata
- Download URL: g4fp-1.1.9-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
359ac7b39c663cfbb4d1d5edfd5f95c47e3cfd65bfd574e9daeedf218e9fa4b4
|
|
| MD5 |
a619a4c50427cbd9817e1f3b3f81459d
|
|
| BLAKE2b-256 |
423391fe052f2a62310198ad14daf35bf3d0f677f972863e0fdb3ab8145008fd
|