Toolhouse

Overview

Toolhouse is a Backend-as-a-Service (BaaS) to build, run, and manage AI agents. Toolhouse simplifies the process of building agents in a local environment and running them in production.

With Toolhouse, you define agents as code and deploy them as APIs using a single command. Toolhouse agents are automatically connected to the Toolhouse MCP Server; it gives agents access to RAG, memory, code execution, browser use, and all the functionality agents need to perform actions. You can add MCP Servers and even define custom code that the agent can use to perform actions not covered by public MCP Servers. Toolhouse has built-in eval, prompt optimization, and agentic orchestration.

For further information about the framework, please check the official documentation:


Integration via Python

Installation

pip install toolhouse openai python-dotenv

Optionally add: pip install groq or other SDKs, depending on the target LLM platform.


Connection Setup

  1. Create a .env file in your project:

TOOLHOUSE_API_KEY=<your_toolhouse_api_key>
AIMLAPI_KEY=<your_aimlapi_key>
  1. Example Python integration (toolhouse_example.py):

import os
from dotenv import load_dotenv
from toolhouse import Toolhouse
from openai import OpenAI

load_dotenv()

th = Toolhouse(api_key=os.getenv("TOOLHOUSE_API_KEY"))

client = OpenAI(
    api_key=os.getenv("AIMLAPI_KEY"),
    base_url="https://api.aimlapi.com/v1",
)

MODEL = "mistralai/Mistral-7B-Instruct-v0.2"

messages = [
    {
        "role": "user",
        "content": "List 3 innovative uses of AI in healthcare."
    }
]

response = client.chat.completions.create(
    model=MODEL,
    messages=messages,
    tools=th.get_tools()
)

tool_run = th.run_tools(response)
messages.extend(tool_run)

response = client.chat.completions.create(
    model=MODEL,
    messages=messages,
    tools=th.get_tools()
)

print(response.choices[0].message.content)

GUI Integration

The Toolhouse GUI (https://app.toolhouse.ai) supports:

  • API key management

  • Tool selection via Bundles

  • Agent execution & history

  • Monitoring tool calls in logs

Tool configuration is managed entirely through their GUI and reflected in tool discovery (th.get_tools()).


Integration via TypeScript

Installation

Install the required dependencies:

npm install @toolhouseai/sdk openai dotenv

Connection Setup

  1. Create a .env file in the project root:

TOOLHOUSE_API_KEY=<Your Toolhouse API Key>
AIMLAPI_KEY=<Your AIMLAPI Key>
  1. Create a TypeScript file (toolhouse.ts) with the following content:

import 'dotenv/config';
import { Toolhouse } from '@toolhouseai/sdk';
import OpenAI from 'openai';

const MODEL = 'mistralai/Mistral-7B-Instruct-v0.2';

async function main() {
  const toolhouse = new Toolhouse({
    apiKey: process.env.TOOLHOUSE_API_KEY,
    metadata: {
      id: "aimlapi-integration",
      timezone: "0"
    }
  });

  const client = new OpenAI({
    baseURL: "https://api.aimlapi.com/v1",
    apiKey: process.env.AIMLAPI_KEY
  });

  const messages = [{
    role: "user",
    content: "List three use cases of AI in retail."
  }];

  const tools = await toolhouse.getTools();
  const chatCompletion = await client.chat.completions.create({
    model: MODEL,
    messages,
    tools
  });

  const toolResponses = await toolhouse.runTools(chatCompletion);
  const finalMessages = [...messages, ...toolResponses];

  const finalResponse = await client.chat.completions.create({
    model: MODEL,
    messages: finalMessages,
    tools
  });

  console.log(JSON.stringify(finalResponse, null, 2));
}

main();
  1. Run the script:

npx ts-node toolhouse.ts

GUI Integration

Toolhouse provides a browser-based GUI at app.toolhouse.ai where you can:

  • Manage API keys

  • Add and organize tools via Bundles

  • Monitor execution logs

  • Trigger and test agents visually

✅ Toolhouse integration with AIMLAPI is fully supported via baseURL override in the OpenAI-compatible SDK.


✅ Supported AIMLAPI Models

All chat-compatible models served by AIMLAPI are supported, including:

  • MistralaiMistral-7B-Instruct, Mixtral-8x7B

  • MetaMeta-LLaMA-3.1, LLaMA-3.3

  • AnthropicClaude-3.5-Haiku

  • NVIDIANemotron-70B

  • Google, xAI, Alibaba, Cohere, DeepSeek – all supported through the unified https://api.aimlapi.com/v1 endpoint.

📘 View our full text (chat) model catalog.


⚙️ Supported Parameters

No AIMLAPI-specific parameter differences were found. Use standard OpenAI-compatible parameters:

  • model

  • messages

  • temperature

  • max_tokens

  • stream

  • tools (Toolhouse integration)


🧠 Supported Call Features

Feature
Via Python
Via TypeScript

Synchronous calls

Asynchronous use

🟡 (manual)

✅ (via Promises)

Tool Calling

Streaming

Threads

Local tools

✅ via registerLocalTool()

Last updated

Was this helpful?