Inference Logoinference.sh

Ad-hoc Agents

Create agents on-the-fly without saving to workspace.


Basic Usage

python
1from inferencesh import inference23client = inference(api_key="inf_your_key")45agent = client.agent({6    "core_app": { "ref": "infsh/claude-sonnet-4@latest" },7    "system_prompt": "You are a helpful assistant."8})910response = agent.send_message("Hello!")11print(response.text)

Configuration Options

python
1agent = client.agent({2    # Required3    "core_app": { "ref": "infsh/claude-sonnet-4@latest" },45    # Optional6    "system_prompt": "You are a helpful assistant.",7    "tools": [...],              # Custom tools8    "skills": [...],             # On-demand context9    "internal_tools": {...},     # Built-in tool settings10    "max_tool_iterations": 10,   # Tool call limit11    "enable_autocomplete": True,1213    # Model parameters14    "temperature": 0.7,15    "max_tokens": 4096,16})

Core Apps

AppDescription
infsh/claude-sonnet-4Claude Sonnet 4
infsh/claude-haiku-35Claude 3.5 Haiku
infsh/gpt-4oGPT-4o
infsh/gpt-4o-miniGPT-4o Mini

With Tools

python
1from inferencesh import tool, string23weather_tool = (4    tool("get_weather")5    .describe("Get current weather")6    .param("city", string("City name"))7    .handler(lambda args: f"Weather in {args['city']}: 72°F, Sunny")8    .build()9)1011agent = client.agent({12    "core_app": { "ref": "infsh/claude-sonnet-4@latest" },13    "system_prompt": "You help with weather info.",14    "tools": [weather_tool]15})1617response = agent.send_message("What's the weather in Paris?")

Skills

Load context on-demand via skill_get:

python
1agent = client.agent({2    "core_app": { "ref": "infsh/claude-sonnet-4@latest" },3    "skills": [4        {5            "name": "code-review",6            "description": "Guidelines for reviewing pull requests",7            "content": "# Code Review\n\nWhen reviewing code..."8        },9        {10            "name": "api-docs",11            "description": "API documentation",12            "url": "https://example.com/skills/api-docs.md"13        }14    ]15})

Internal Tools

Enable built-in tools:

python
1agent = client.agent({2    "core_app": { "ref": "infsh/claude-sonnet-4@latest" },3    "internal_tools": {4        "web_search": True,5        "code_execution": True,6        "image_generation": {7            "enabled": True,8            "app_ref": "infsh/flux@latest"9        }10    }11})

we use cookies

we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.

by clicking "accept", you agree to our use of cookies.
learn more.