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 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.3.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.3-py3-none-any.whl
(15.2 kB
view details)
File details
Details for the file g4fp-1.2.3.tar.gz.
File metadata
- Download URL: g4fp-1.2.3.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 |
d0e5698d5d5731df073cde9088ecad808353ba2ba8c78c20bb5dce69cdad058e
|
|
| MD5 |
afb8f25437f800b3769ea89897328987
|
|
| BLAKE2b-256 |
b552f307b7396c905ba44050a3014a2d2940aaf7abe30d2e065ac5f6c6cbe524
|
File details
Details for the file g4fp-1.2.3-py3-none-any.whl.
File metadata
- Download URL: g4fp-1.2.3-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 |
dbc123e681bb1c33a6e33602e5c8f2416136ce3b2e654c6cc8b7fbcb8168ec7a
|
|
| MD5 |
9afddd02a9dfd4c6cee4976c58737bb7
|
|
| BLAKE2b-256 |
ebdc643885cbff7bc3abdf0d313eae8aa24da051bdf23a02df1bda5d34b5c6af
|