Introduction
The Friendli Python SDK provides a powerful and flexible way to interact with FriendliAI services, including Model APIs, Dedicated Endpoints, and Container. You can easily integrate your Python applications with FriendliAI.Installation
The SDK can be installed with either pip or poetry:Authentication
Authentication is done using a Personal API key, which can be generated from the Friendli Suite > Personal Settings > API Keys:Chat Completions
The SDK supports chat completions across all deployment types. Choose the deployment option that best fits your needs.Asynchronous Chat Completions
Advanced Features
Streaming Responses
The SDK supports streaming responses using server-sent events, which you can consume using a simplefor loop: