Goals
- Build your own AI agent using Friendli Model APIs and Gradio in less than 50 LoC
- Share your AI agent with the world and gather feedback
Gradio is the fastest way to demo your model with a friendly web interface.
Getting Started
- Head to Friendli Suite, and create an account.
- Grab a Personal API Key to use Friendli Model APIs within an agent.
Step 1. Prerequisite
Install dependencies.Step 2. Launch Your Agent
Build your own AI agent using Friendli Model APIs and Gradio.- Gradio provides a
ChatInterfacethat implements a chatbot UI running thechat_function.- More information about the chat_function(message, history)
The input function should accept two parameters: a string input message and list of two-element lists of the form [[user_message, bot_message], …] representing the chat history, and return a string response.
- More information about the chat_function(message, history)
- Implement the
chat_functionusing Friendli Model APIs.- Here, we used the
zai-org/GLM-5.2model. - Feel free to explore other available models.
- Here, we used the