Skip to main content

Python SDK for Hunt — the open-source agent harness

Project description

Hunt Python SDK

Agent-native AI inference. Retry, budget control, and cost tracking built in.

Install

pip install hunt-sdk

Quick start

from hunt import HuntClient

client = HuntClient(api_key="hunt_sk_live_...")

response = client.chat("What is ARM architecture?")
print(response)
print(client.usage)  # TokenUsage(requests=1, tokens=142, cost=$0.000047)

Agent runs

Run multi-step agent workflows with automatic budget control:

from hunt import HuntClient, Agent

client = HuntClient(api_key="hunt_sk_live_...")

agent = Agent(
    client=client,
    system="You are a data analyst. Be concise.",
    max_steps=10,
    budget=0.05,  # stop if cost exceeds $0.05
)

run = agent.run("What are the top 3 trends in AI infrastructure?")

print(run.final_output)
print(run.summary())
# {'run_id': 'a1b2c3d4e5f6', 'model': 'hunt-llama-3.1-8b', 'status': 'success',
#  'steps': 1, 'total_tokens': '285', 'total_cost': '$0.000094',
#  'total_latency': '823ms', 'budget': '$0.05'}

Agent with tools

def search(query: str) -> str:
    """Search the web for information."""
    return f"Results for: {query}..."

def calculate(expression: str) -> str:
    """Evaluate a math expression."""
    return str(eval(expression))

agent = Agent(
    client=client,
    system="You are a research assistant with access to search and calculation tools.",
    tools={"search": search, "calculate": calculate},
    max_steps=20,
    budget=0.10,
)

run = agent.run("How many tokens can a 80-core Ampere Altra process per month?")
print(run.final_output)

# See every step
for step in run.steps:
    print(f"  [{step.role}] {step.content[:80]}... (${step.cost_usd:.6f})")

Step callbacks

Monitor agent execution in real-time:

def on_step(step):
    if step.role == "assistant":
        print(f"Step {step.index}: {step.content[:60]}... (${step.cost_usd:.6f})")
    elif step.role == "tool":
        print(f"  Tool [{step.tool_call}]: {step.content[:60]}...")

agent = Agent(
    client=client,
    on_step=on_step,
    max_steps=15,
    budget=0.10,
)

run = agent.run("Analyze the cost of running Llama 8B on ARM vs GPU")

Models

All models are $0.02 per agent run (15K tokens included). Overage: $0.003/1K tokens above 15K.

Model Size Context Best For
hunt-llama-3.1-8b 8B 128K General-purpose agents
hunt-mistral-7b 7B 32K Fast single-step tasks
hunt-qwen-2.5-7b 7B 128K Multilingual agents

OpenAI SDK compatibility

Hunt is a drop-in replacement. Use the OpenAI SDK directly:

from openai import OpenAI

client = OpenAI(
    base_url="https://api.huntinference.com/v1",
    api_key="hunt_sk_live_...",
)

# Works exactly the same
response = client.chat.completions.create(
    model="hunt-llama-3.1-8b",
    messages=[{"role": "user", "content": "Hello"}],
)

The Hunt SDK adds retry logic, budget control, and cost tracking on top.

License

MIT

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

hunt_sdk-0.1.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

hunt_sdk-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file hunt_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: hunt_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for hunt_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4619f77a8514b38f4683d9b766a8cf811586815c64f3cb27fe0b11a8a3735e99
MD5 42b64249679d62a6dcdc1006f7b7a8a8
BLAKE2b-256 a28fa7dacfe9521c5b10bfe3737ef35df95dbe2657eff7d544969a7027d5ead9

See more details on using hashes here.

File details

Details for the file hunt_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hunt_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for hunt_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a756d77b8264cd6122e3d14c9c070be34b1b4bd4921504126dddae0518d162c
MD5 e2a39e5f745f4672335c985d3993441d
BLAKE2b-256 d1c34a126255b3747e915449b0e294b42ce33900e308582d73697653bc341f6f

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