Skip to main content

A flexible LLM orchestration framework with tool calling capabilities via MCP protocol

Project description

Jiki

Jiki is a flexible LLM orchestration framework with built-in tool calling capabilities.

Overview

Jiki provides a clean interface for building AI assistants that can use tools to solve problems. It orchestrates the interaction between language models and external tools using the MCP (Model Context Protocol).

Features

  • Seamless integration with LiteLLM for support of multiple LLM providers
  • Tool calling through FastMCP infrastructure
  • Flexible MCP client with multiple transport options (stdio, SSE)
  • Structured conversation logging for training data generation
  • Simple CLI interface for interactive use
  • XML-based tool call format for clear model interaction

Quick Start

uv add jiki
from jiki import create_jiki

# Create a pre‑configured orchestrator with sensible defaults
orchestrator = create_jiki(
    model="anthropic/claude-3-7-sonnet-latest",
    # Path to a JSON file that describes your tools (see below)
    tools="tools.json",
    mcp_mode="stdio"  # or "sse" to connect to a remote FastMCP server
)

# Process a user query (synchronous helper available)
result = orchestrator.process("What is 2 + 2?")
print(result)

CLI Usage

uv run examples/simple_multiturn_cli.py --tools tools.json

Detailed Responses & Tracing

Jiki can return a rich DetailedResponse object that includes the assistant's answer and all tool calls / raw traces generated during the turn. This is useful for debugging, analytics, or offline reinforcement‑learning pipelines.

# Get a structured response with trace metadata
detailed = orchestrator.process_detailed("What is the capital of France?")

print(detailed.result)      # The assistant's final answer
print(detailed.tool_calls)  # List[ToolCall] detailing every tool invocation
print(detailed.traces)      # Raw trace dictionaries for deeper inspection

# Persist traces from the current session
orchestrator.export_traces("interaction_traces/session.jsonl")

Creating Custom Tools

Tools are defined in JSON format and implemented using FastMCP:

{
  "tool_name": "add",
  "description": "Add two numbers",
  "arguments": {
    "a": {"type": "integer", "description": "First number"},
    "b": {"type": "integer", "description": "Second number"}
  }
}

Server implementation:

from fastmcp import FastMCP

mcp = FastMCP("Calculator")

@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return a + b

if __name__ == "__main__":
    mcp.run()

Requirements

  • Python 3.11+
  • litellm >= 1.35.0 (or the latest)
  • fastmcp >= 2.1.1
  • mcp
  • tiktoken (optional – enables exact token counting)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jiki-0.0.4.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jiki-0.0.4-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file jiki-0.0.4.tar.gz.

File metadata

  • Download URL: jiki-0.0.4.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.9

File hashes

Hashes for jiki-0.0.4.tar.gz
Algorithm Hash digest
SHA256 abe8e6c836c0124eebd25653c5b44d6635f93933ce80eaf8d04f75393b5a4659
MD5 c682fbfc8a6a49cf300638f840e8b721
BLAKE2b-256 724d8f59dee0c1fc21d6b38a307ff4c40c8712792f105a6fd98a7a4b5cdb89b1

See more details on using hashes here.

File details

Details for the file jiki-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: jiki-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.9

File hashes

Hashes for jiki-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 79ee4dce286aa9111c67871bc7339d3ae3ee354c2155b8f01d5f53dd87a18b49
MD5 06404be27727a83a04b13a5f69071d04
BLAKE2b-256 fbd8ba40d2df046719ea5254ba2f95ec9c3ebc4919b56d8b24d035f6b27bb16e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page