Inference Logoinference.sh

Ad-hoc Agents

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


Basic Usage

1from inferencesh import inference2 3client = inference(api_key="inf_your_key")4 5agent = client.agent({6    "core_app_ref": "infsh/claude-sonnet-4@latest",7    "system_prompt": "You are a helpful assistant."8})9 10response = agent.send_message("Hello!")11print(response.text)

Configuration Options

1agent = client.agent({2    # Required3    "core_app_ref": "infsh/claude-sonnet-4@latest",4    5    # Optional6    "system_prompt": "You are a helpful assistant.",7    "tools": [...],              # Custom tools8    "internal_tools": {...},     # Built-in tool settings9    "max_tool_iterations": 10,   # Tool call limit10    "enable_autocomplete": True,11    12    # Model parameters13    "temperature": 0.7,14    "max_tokens": 4096,15})

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

1from inferencesh import tool, string2 3weather_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)10 11agent = client.agent({12    "core_app_ref": "infsh/claude-sonnet-4@latest",13    "system_prompt": "You help with weather info.",14    "tools": [weather_tool]15})16 17response = agent.send_message("What's the weather in Paris?")

Internal Tools

Enable built-in tools:

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.