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 (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


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)

Uploaded Source

Built Distribution

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

g4fp-1.1.9-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

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

Hashes for g4fp-1.1.9.tar.gz
Algorithm Hash digest
SHA256 311c4e43aa896624a65ec5760487317ee887d2ad8f20cf8fde2a0ac0e77feb49
MD5 536bcb1f08e9c09f762e0ace7a6f0bcb
BLAKE2b-256 348e9f246d0d32b3c600b3b396a22fc0829ba1370e6c5197e8f5eb2029809bc2

See more details on using hashes here.

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

Hashes for g4fp-1.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 359ac7b39c663cfbb4d1d5edfd5f95c47e3cfd65bfd574e9daeedf218e9fa4b4
MD5 a619a4c50427cbd9817e1f3b3f81459d
BLAKE2b-256 423391fe052f2a62310198ad14daf35bf3d0f677f972863e0fdb3ab8145008fd

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