Friendli-client

Latest version: v1.4.1

Safety actively analyzes 641872 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 6

1.4.1

Updating Patch Version

This patch version Introduces explicit resource management to prevent unexpected resource leaks.
By default, the library closes underlying HTTP and gRPC connections when the client is garbage-collected. However, you can now manually close the `Friendli` or `AsyncFriendli` client using the `.close()` method or utilize a context manager to ensure proper closure when exiting a `with` block.

Usage examples

python
import asyncio
from friendli import AsyncFriendli

client = AsyncFriendli(base_url="0.0.0.0:8000", use_grpc=True)

async def run():
async with client:
stream = await client.completions.create(
prompt="Explain what gRPC is. Also give me a Python code snippet of gRPC client.",
stream=True,
top_k=1,
)

async for chunk in stream:
print(chunk.text, end="", flush=True)

asyncio.run(run())

1.4.0

- gRPC client support for completions API.

1.3.7

- Minor: add a default value for the "index" and "text" fields of the completion stream's chunk.

1.3.6

- Support Phi3 FP8 conversion.
- Hotfix for safetensor checkpoint saver.

1.3.5

- Optimize CPU RAM usage during quantization with offloading
- Support FP8 conversion for DBRX, Mixtral, and Command R+

1.3.4

- Hotfix for LoRA checkpoint saving error.

Page 1 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.