TwoAI

作者 Fus3n已验证

A simple experiment on letting two local LLM have a conversation about anything!

112
Stars
15
Forks
Python
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/Fus3n/TwoAI

快速入门

使用 TwoAI 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

TWOAI

A simple experiment on letting two local LLM have a conversation about anything!

If you want to discuss more join the discord!

Discord

Another example

Installation

First you need Ollama, install the executable as per the instructions. After that just make sure ollama is running in background, check your system tray. then find the model you like https://ollama.com/library and just do:

ollama pull <model-name>

The installation commands are usually in the library page.

Usage for TwoAI

Example in src/example/main.py If you are using pdm you can install the package as with pdm install

  • Manual
git clone https://github.com/Fus3n/TwoAI
cd TwoAI
pip install -r requirements.txt
python src/example/main.py llama3
# with pdm
pdm run example llama3
# Setup

BASE_MODEL = "llama3" # need to be pulled first if you want to use this, `ollama pull llama3`

sys_prompt = """
You are a very intelligent AI Chatbot and your name is {current_name}, Now
you will be having a converstaion with another AI called {other_name}, and its also same as you.
{current_objective} Keep each message short and concise and repeat "<DONE!>" ONLY if you both established and agreed that you came to the end of the discussion. 
""".strip()

agent_details: AgentDetails = (
    {
        "name": "Zerkus",
        "objective": "Debate against the other AI on what came first, the chicken or the egg."
        "and you think the chicken came first."
        "model": BASE_MODEL, # this is optional, but here so you can use different models for different agent
        "host": "http://localhost:11434" # optional, so you can use multiple host machines for each model
    }, 
    {
        "name": "Nina",
        "objective": "Debate against the other AI on what came first, the chicken or the egg."
        "and you think the Egg came first."
    }
)

twoai = TWOAI(
    model=BASE_MODEL, 
    agent_details=agent_details, 
    system_prompt=sys_prompt
    exit_word="<DONE!>",
    max_exit_words=2,
)

Now to get response there are two ways

twoai.next_response(show_output=True)
twoai.next_response(show_output=True)
twoai.next_response(show_output=True)

Result will be something like:

Zerkus: The chicken came first.
Nina: The egg came first.
Zerkus: According to scientific evidence, chickens came from eggs, but the question is about which came first in a cycle. Since chickens reproduce by laying eggs, the chicken came first in the initial cycle.

Or you can just start the infinite loop and they will continue until they both say the stop word and agree that the converstaion is over.

twoai.start_conversation()

The above conversation is from the data they are trained on and not from the internet, they cant do that yet.

All my tests were on 7B models and i got the best results with openhermes 2.5 and spooknik/kunoichi-dpo-v2-7b:q5_k_s

Problem solving and more use cases

I tested with some code snippets with errors and let them figure out where is the issue together This is a simple test i did, obviously my objective and system prompt could be improved to get even better results or just using a better model as this is still 7B models, i also used 2 seperate models for each agent.

Preview

https://github.com/Fus3n/TwoAI/assets/52007265/58e71471-1c8c-445f-a3dc-b85b8627ff63

System Prompt

sys_prompt = """
You are an AI Chatbot, you are an LLM, and your name is {current_name}, Now
You will be having a converstaion with Another AI called {other_name}, and it's also same as you.
\```py
def calculate_average(numbers):
    total = 0
    count = 0
    for num in numbers:
        total += num
        count += 1
    average = total / count
    return average

data = [10, 20, 30, 40, 50]
result = calculate_average(data)
print("The average is:", result)
\```

{current_objective} And repeat "<DONE!>" ONLY if you both established and agreed that you came to the end of the discussion. 
""".strip()

Agent Details

# they both have the same objective in this case so you could omit the {current_objective} and just use sytem prompt, as its used for both.
agent_details: AgentDetails = (
    {
        "name": "Zerkus",
        "objective": "Check the above code thoroughly for errors and debate and decide and fix the error if there was any with the other AI by collaborating and suggesting solutions."
        "Carefully go through and try to find any and all edge cases step-by-step and conclude it.",
        "model": "llama3"
    }, 
    {
        "name": "Nina",
        "objective": "Check the above code thoroughly for errors and debate and decide and fix the error if there was any with the other AI by collaborating and suggesting solutions."
        "Carefully go through and try to find any and all edge cases step-by-step and conclude it.",
        "model": "gemma2"
    }
)

TwoAI

twoai = TWOAI(
    model=BASE_MODEL, # not used but required parameter
    agent_details=agent_details, 
    system_prompt=sys_prompt,
    max_tokens=6094,
    num_context=4094*2
)

常见问题

What is TwoAI?

TwoAI is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by Fus3n. A simple experiment on letting two local LLM have a conversation about anything!. It has 112 GitHub stars.

Is TwoAI safe to use?

Yes. TwoAI passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install TwoAI?

Clone the repository with "git clone https://github.com/Fus3n/TwoAI" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is TwoAI written in?

TwoAI is primarily written in Python. It is open-source under Fus3n on GitHub, so you can review or fork the full source.

Are there alternatives to TwoAI?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh TwoAI against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情