实践PI

Pi is a minimal agent harness.Adapt Pi to your workflows, not the other way around.

Pi (github) AI agent toolkit: unified LLM API, agent loop, TUI, coding agent CLI.

LiteLLM

安装 LiteLLM provider

1
pi install npm:pi-provider-litellm

启动

1
pi

在 Pi 里面执行:

1
/login litellm

选择 API Key 登录,然后填写:

1
2
3
4
5
Base URL:
https://llm-router.ronhan.com/v1

API Key:
LiteLLM分配的key

之后它会尝试通过 LiteLLM 的 /model/info 或 /v1/models 自动获取可用模型。

1
/model