python-sdk

Build AI applications and agents in Python using the inference.sh SDK.

Updated Jul 28, 2026
One-click install
npx skills add https://github.com/Aadi-110i/PEP-PROJECT --skill python-sdk-aadi-110i
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-sdk
Source: https://github.com/Aadi-110i/PEP-PROJECT/tree/main/skills/python-sdk
Command: npx skills add https://github.com/Aadi-110i/PEP-PROJECT --skill python-sdk-aadi-110i

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires inferencesh, and includes references (resource) components.

What problem does it solve? Integrating AI models and building agents in Python typically requires stitching together multiple APIs, handling file uploads, managing streaming responses, and orchestrating tool calls manually. This Skill provides a unified SDK for running 250+ AI apps, creating agents with tools, and managing stateful sessions through one consistent Python interface. ## Core Features & Use Cases - Run AI Apps Programmatically: Execute any inference.sh app with sync or async clients, streaming progress updates, and automatic file uploads. - Agent Development: Create template-based or ad-hoc agents with a tool builder API supporting client tools, app tools, agent tools, webhook tools, and built-in capabilities like web search and code execution. - Stateful Sessions & Human Approval: Keep workers warm across calls with sessions, and enforce human-in-the-loop approval for sensitive tool executions. - Use Case: Build a RAG pipeline where an agent uses a search tool to retrieve current information, then generates a cited answer, all orchestrated through a few lines of Python with async batch processing for multiple queries. ## Quick Start Install the inferencesh package with pip and use the Python SDK to run an AI app or create an agent with your inference.sh API key.

Frequently Asked Questions about python-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run an AI app with the inference.sh Python SDK?

Install the package with pip install inferencesh, create a client with inference(api_key="inf_..."), then call client.run with the app ID and input dictionary. The result contains the status and output data.

How do I build an agent with custom tools in Python?

Use the tool builder API to define tools with tool(), app_tool(), agent_tool(), or webhook_tool(), specifying parameters with types like string, number, or enum_of. Pass the tools list to client.agent along with a core_app model reference and system prompt.

Does the inferencesh SDK support async and streaming?

Yes, the SDK provides an async_inference client for asyncio-based code, supporting await client.run and async iteration over streaming updates. The sync client also supports stream=True to receive real-time progress updates and logs.

How do I upload files for AI app inputs in Python?

Local file paths in the input dictionary are uploaded automatically. For manual control, call client.upload_file with a path, bytes, or file object, plus UploadFileOptions for filename, content type, and public access.

What are sessions in the inference.sh SDK and when should I use them?

Sessions keep workers warm between requests by passing session="new" to create one and reusing the returned session_id. Use them for model loading, browser automation, or multi-turn conversations to avoid cold starts, with timeouts from 1 to 3600 seconds.

How do I add human approval to agent tool calls?

Call .require_approval() when building a tool, then check call.requires_approval in your on_tool_call handler. Prompt the user for confirmation and submit the result or a denial via agent.submit_tool_result.