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="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)
messages = [
    {"role": "user", "content": "Hello!"}
]
response = client.chat.completions.create(
    model="o3-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.2.tar.gz (15.0 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.2-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for g4fp-1.2.tar.gz
Algorithm Hash digest
SHA256 18b14bfda150da5fac9d4aa877bd7801b1129e13188ae25f373706e8584bfa3f
MD5 83d6f9208142a85174dc5e4945f5e873
BLAKE2b-256 7d327f4bc7e52e237984cb84b14f62b53978c96947d182d04af645a0dfa116f0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: g4fp-1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.1 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a88a5ebd549b3ba6bd46f44387fb92e76ba8d6944d4f2788e26d8d8cc96005ee
MD5 09923436733cc87854fb196c4f2b9c82
BLAKE2b-256 df7303b0ba38aa56f0881065a838684496cc10451762164e1efc3a516657d7e9

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