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.4.tar.gz (14.6 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.4-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: g4fp-1.1.4.tar.gz
  • Upload date:
  • Size: 14.6 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.4.tar.gz
Algorithm Hash digest
SHA256 a8b352e2dffdcd8e478ffc580d8725c957ac5108e8abc1545e9506bc64beb79a
MD5 e67e18af0edc472a845f43a85b642836
BLAKE2b-256 ef97c4555880cf08d452ff3cf3d753e5a5dd2ff55603bb315467e1eb6c720a40

See more details on using hashes here.

File details

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

File metadata

  • Download URL: g4fp-1.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ae8ed8b041d2616195185767304e867c27f70c5650ba44a0f99414ecfc2d194d
MD5 60e87969919a21693e9dac5b00af4bda
BLAKE2b-256 8ae434872d216b6971402d9f19fcaa2479c8ca016776f354108a9cb6d80d1bff

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