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, proxy_fetch_url="https://proxyleet.com/proxy/type=http&speed=479&key=<api_key>")
messages = [
{"role": "user", "content": "Hello!"}
]
response = await client.chat.completions.create(
model="o3-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, proxy_fetch_url="https://proxyleet.com/proxy/type=http&speed=479&key=<api_key>")
messages = [
{"role": "user", "content": "Hello!"}
]
response = client.chat.completions.create(
model="o3-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.2.2.tar.gz
(15.1 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.2.2-py3-none-any.whl
(15.2 kB
view details)
File details
Details for the file g4fp-1.2.2.tar.gz.
File metadata
- Download URL: g4fp-1.2.2.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30f2ee109783cdc57ed6f32a1204b73eff450b2a5711b8b64586c1ca780b1eb8
|
|
| MD5 |
8685dac22db6962a45edafdbb6daef37
|
|
| BLAKE2b-256 |
cc584a114edda6c6040fc9b6cd2adcf57084da0bc1217a9b2941838a07ae6aaf
|
File details
Details for the file g4fp-1.2.2-py3-none-any.whl.
File metadata
- Download URL: g4fp-1.2.2-py3-none-any.whl
- Upload date:
- Size: 15.2 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 |
3d75f7db83a32cfcf22232c13e315f12d47b53280961400f8cddd672e629b19d
|
|
| MD5 |
eac31140f61e2accdcfedffc705fbbe9
|
|
| BLAKE2b-256 |
41cc5a1a982fb615c96e46d97788f83423124a57cbf85b1b3383daf42b636e1c
|