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) 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": "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.3.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.3-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: g4fp-1.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 c4b909011e129b0727df424cca29a82eb78986b0293a85c2fa2da351e6fb91bf
MD5 1cd0fcc78feb38c21a54698ca52aba0e
BLAKE2b-256 e2d9f696c59f9435d03b10d817f1f55dbe5427c5c930c30913690e547fac1566

See more details on using hashes here.

File details

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

File metadata

  • Download URL: g4fp-1.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 712b20b805822ab13da9a96fa4ec73f2bb30336d3fc7514ccd1280709c510bb3
MD5 52872f3f34248295c9126e76b7ecf314
BLAKE2b-256 d88114f5a1e7bacf49d9c6c18f1cca667db7c1757594cd27fc8c4af811834490

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