semvec/pypi-packages huggingface dataset:
llamux 0.1.9
A simple llm router
License: MIT
Requires Python: <4.0,>=3.11

[![GitHub stars](https://img.shields.io/github/stars/andreakiro/llamux-llm-router?style=social)](https://github.com/andreakiro/llamux-llm-router/stargazers)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![PyPI version](https://img.shields.io/pypi/v/llamux)](https://pypi.org/project/llamux/)
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)

# llamux 🦙

A simple router to rotate across your configured LLM endpoints, balancing load and avoiding rate limits. The router selects your preferred provider-model pair based on an implicit preference list, ensuring token and request limits (day/hour/minute) aren't crossed. State persists across sessions, with quotas stored in local cache.

# Install

Requires Python 3.11+

```bash
pip install llamux
```

# Usage

You need first to set the list of endpoints you want to allow routing on;

```markdown
$ > endpoints.csv

| provider | model                   | rpm | tpm   | rph   | tph     | rpd   | tpd     |
| -------- | ----------------------- | --- | ----- | ----- | ------- | ----- | ------- |
| cerebras | llama3.3-70b            | 30  | 60000 | 900   | 1000000 | 14400 | 1000000 |
| groq     | llama-3.3-70b-versatile | 30  | 6000  | 14400 |         | 14400 |         |
```

where rpm, tpm are requests and tokens limits per minutes, and the same follows for hours and days. **Important note 🔊** Your implicit preference list is given by the ordering of the endpoints in this table. In the above, we'll always prefer Cerebras over Groq, as long as the quota limits are not exceeded.

## Use it as a standalone router;

```python
from llamux import Router

os.environ["CEREBRAS_API_KEY"] = "sk-..."
os.environ["GROQ_API_KEY"] = "sk-..."

router = Router.from_csv("endpoints.csv")
messages = [{"role": "user", "content": "Hello, how are you?"}]

provider, model, id, props = router.query(messages)
# provider: cerebras, model: llama3.3-70b
```

## Or use it directly as a completion endpoint;

```python
from llamux import Router

router = Router.from_csv("endpoints.csv")
messages = [{"role": "user", "content": "hey" * 59999}]

response = router.completion(messages) # calls cerebras
response = router.completion(messages) # calls groq (cerebras quota is out!)
```

The above builds upon [litellm](https://github.com/BerriAI/litellm) llm proxy

## More features

Contributions are welcome :)

- [ ] Add support for speed and cost routing preferences
- [ ] Add other routing strategies (now preferencial ordering only)
- [ ] Avoid getting preference listing from table ordering
fishpi 0.2.1
Package used to Call All FishPi API.
License: MIT
Requires Python: >=3.6.0


# 摸鱼派 API Package
摸鱼派社区 (https://fishpi.cn/) 的 API Package，可以快速开发出一款应用支援社区功能。

## 支援
- 用户信息；
- 聊天室；
- 文件上传；
- 通知信息；

## 安装

```bash
pip install fishpi
```

## 用例

```python
from fishpi import FishPi

# 登录获取 apiKey
apiKey = ''
fish = FishPi()
rsp = fish.login(
    username='username', 
    passwd='password123456',
    mfaCode='789546'
)
if rsp['code'] == 0:
    apiKey = rsp.Key

# 通过 apiKey 获取登录用户信息
fish = FishPi(apiKey)
fish.account.info()

# 获取用户自定义表情包
emojis = fish.emoji.get()
# 获取默认表情包
defaultEmoji = fish.emoji.default

# 监听聊天室消息
fish.chatroom.add_listener(lambda msg: print(msg))
# 向聊天室发送信息（需要登录）
fish.chatroom.send('Hello World!')
# 向聊天室发送红包
fish.chatroom.redpacket.send(
    type='random',
    money=32,
    count=2,
    msg='摸鱼者，事竟成！',
)

```