Skip to main content

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": "Привет!"}
    ]
    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": "Привет!"}
]
response = client.chat.completions.create(
    model="o1-mini",
    messages=messages,
)
print(response.choices[0].message.content)

Project details


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.1.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

g4fp-1.1.1-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file g4fp-1.1.1.tar.gz.

File metadata

  • Download URL: g4fp-1.1.1.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.0

File hashes

Hashes for g4fp-1.1.1.tar.gz
Algorithm Hash digest
SHA256 5f2a4031f4c9cee3324272561abef6f32d00cfc2070322ccaa29c37064fe0e47
MD5 7c642fd2474e36282528d48548e4e9fc
BLAKE2b-256 182355ebf592b6fd80047c22a40428a3b0ee39c66344635b92d9f13b48a0e94f

See more details on using hashes here.

File details

Details for the file g4fp-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: g4fp-1.1.1-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

Hashes for g4fp-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e8be8957a7e8754d76629a443532b304214c66730a452dfd3ef3592e9a0598fc
MD5 2d2b971c9e961a880812f86f648dcd60
BLAKE2b-256 d3ee144886f5244ec11a6cb702ae71d9eac5e11972cf4ee74f9542c1c3dc67fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page