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

Usage example (async):

import asyncio
from g4fp import AsyncClientProxy

async def main():
    client = await AsyncClientProxy()
    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()
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.0.2.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.0.2-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for g4fp-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f5c93c2da8d98a466964c49dd0021d5f5c179b64be163012f8dc3abc9330fe95
MD5 dda85d755abd67f0e47d89b697099b53
BLAKE2b-256 580c93b8426e3aa72b8c5e17434c11a5a4b81b0fef954ca1c34d8d4c269fc119

See more details on using hashes here.

File details

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

File metadata

  • Download URL: g4fp-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.7 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.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 153128098d939aba951a82cea879a1dd78473b33a4b646513f8a249147bb0a39
MD5 98584a40265bd5dea1f9df34fdb23d54
BLAKE2b-256 4e7ccf242d23c73b4c73fadc3dd08be305ecaa6b90d313b7688820888ec5fa38

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