semvec/pypi-packages huggingface dataset:
logformat 0.1.0
logfmt logging for Python
Requires Python: >=3.13

# logformat - logfmt logging for Python

* implements the same value escaping as the [logfmt library] used by Grafana Loki
* implements a `logging.Formatter` so it works with any library using the standard library logging
* implements a convenience wrapper around `logging.Logging` for specifying structured fields via `kwargs`

```python
import logging

import logformat

logfmt_handler = logging.StreamHandler()
logfmt_handler.setFormatter(logformat.LogfmtFormatter())
logging.basicConfig(handlers=[logfmt_handler], level=logging.INFO)

logger = logformat.get_logger()

logger.warning("this seems off", some_id=33)
```

Will output a line like:

```
time=2025-03-23T06:21:36Z level=warning msg="this seems off" some_id=33
```

`exc_info` and `stack_info` are supported via `backtrace=True` and `stack=True`
(which will add same-named fields).

In the main method of a script you should always catch any exception and log
them as errors, so that unexpected errors show up properly in your log file.
This library makes this easy by providing a `log_uncaught` decorator:

```python
logger = logformat.get_logger()

@logger.log_uncaught
def run():
    # your script
    ...
```

This library intentionally doesn't provide any pretty terminal output but the
produced logs can be viewed with the [logfmt CLI] (since that tool again uses
the [logfmt library] that this library is compatible with).

## Alternatives

* structlog's `get_logger` returns `Any`.
  While there's a typed alternative that's a bit of a footgun.

* logfmter doesn't include the time by default, names the time field `when` by default
  and the level field `at` by default, doesn't use ISO dates by default
  and isn't compatible with the Go [logfmt library] as of March 2025

[logfmt library]: https://github.com/go-logfmt/logfmt
[logfmt CLI]: https://github.com/TheEdgeOfRage/logfmt
llm-memory 0.2.1
A memory management system for large language models
Requires Python: >=3.7

## LLM Memory

一个专为大语言模型设计的记忆管理系统，支持基于重要性的记忆筛选和持久化存储。

## 安装

```bash
使用以下命令安装：
pip install llm-memory
```

## 使用示例：
```python
from llm_memory import CombinedMemory

# 初始化记忆系统
memory = CombinedMemory(
    max_size=100,                # 最大记忆容量
    system_prompt="你是一个助手",  # 系统提示词
    uid="user123",              # 用户ID，用于数据库存储
    recent_size=20              # 保留最近对话轮数
)

# 添加消息
memory.add_message("user", "你好", importance=1)
memory.add_message("assistant", "你好！有什么我可以帮你的吗？", importance=1)

# 获取上下文
context = memory.get_context()

# 保存到数据库
memory.save_memory_to_db()
```
## 参数说明：
- system_prompt: 系统提示词，可选
- uid: 用户唯一标识，用于数据库存储，可选
- max_size: 最大记忆容量，必需
- recent_size: 保留最近对话轮数，默认为20轮

## 特性：

- 基于重要性的记忆管理
- 自动保持最近的对话（可配置保留轮数）
- 支持数据库持久化
- 可配置的系统提示词

## 数据持久化：

当提供 uid 参数时，会自动将对话历史保存到本地数据库（使用 TinyDB）。数据库文件默认保存为 memory.json。

## 依赖：

Python >= 3.7
tinydb >= 4.7.0

## 许可证：

MIT License
bilibili-search-cli 1.0.0
A command-line tool to search videos on Bilibili
Requires Python: >=3.6

# Bilibili Search CLI

A command-line tool to search videos on Bilibili and output results in JSON format.

## Features

- Search videos on Bilibili from command line
- Output results in structured JSON format
- Customizable number of results
- Anti-crawler protection built-in

## Installation

```bash
pip install bilibili-search-cli
```

## Usage

Basic search:
```bash
bilibili-search "happy new year"
```

Limit number of results:
```bash
bilibili-search "dance" -n 5
```

Search with spaces in keyword:
```bash
bilibili-search "music video" -n 10
```

Get help:
```bash
bilibili-search --help
```

## Output Format

The tool outputs JSON-formatted data:

```json
{
  "keyword": "happy new year",
  "total_count": 5,
  "videos": [
    {
      "title": "Happy New Year 2025",
      "author": "username",
      "bvid": "BV1X3XbYkEYZ",
      "play_count": 341,
      "duration": "45:22",
      "pubdate": "2025-03-23 11:34:40",
      "url": "https://www.bilibili.com/video/BV1X3XbYkEYZ"
    }
    // ... more videos
  ]
}
```

## Requirements

- Python 3.6 or higher
- requests
- fake-useragent

## License

MIT License
cartesia-mlx 0.0.2
The official Cartesia MLX library.
Requires Python: >=3.9.0


# Cartesia MLX

This package contains implementations for fast on-device SSM inference on Apple silicon. 

## Installation
To install this package, first follow the [installation instructions for `cartesia-metal`](../cartesia-metal/README.md#Installation).
Next (in your Python environment) install the `cartesia-mlx` package:
```shell
pip install cartesia-mlx
```

Note: This package has been tested on macOS Sonoma 14.1 with the M3 chip.

## Models

### Language Models
- `cartesia-ai/Llamba-1B-4bit-mlx` 
- `cartesia-ai/Llamba-3B-4bit-mlx`
- `cartesia-ai/Llamba-8B-4bit-mlx`
- `cartesia-ai/Llamba-8B-8bit-mlx`
- `cartesia-ai/Mohawk-v0.1-1.3B-4bit-mlx` 
- `cartesia-ai/Rene-v0.1-1.3b-4bit-mlx` 
- `cartesia-ai/mamba2-130m-8bit-mlx` 
- `cartesia-ai/mamba2-130m-mlx` 
- `cartesia-ai/mamba2-370m-8bit-mlx` 
- `cartesia-ai/mamba2-780m-8bit-mlx` 
- `cartesia-ai/mamba2-1.3b-4bit-mlx` 
- `cartesia-ai/mamba2-2.7b-4bit-mlx` 

## Usage
A simple example script for generation can be found in `cartesia-mlx/example.py`.
Usage example (clone this repo and run the below from within the `cartesia-mlx` directory):
```shell
python example.py --model cartesia-ai/Mohawk-v0.1-1.3B-4bit-mlx --prompt "Rene Descartes was"
```

You can pass any of the models listed above to the `--model` argument; for a full list of command-line options, pass `--help`.

## Performance
Our SSM-based LMs deliver SOTA quality and throughput, with constant tokens per second (tok/s) and memory requirements, making them an ideal choice for on-device applications.

<img src="assets/quality-throughput.png" alt="Quality/Throughput comparison (1-2B)" style="width:70%;"/>

At increasing context size, the throughput of transformer-based LMs drops rapidly, and memory consumption skyrockets, making them inefficient. In contrast, our distilled pure-SSM LlaMamba retains constant tokens per second (tok/s) and memory consumption, unlocking reasoning capabilities over much larger contexts on-device. This constant memory usage is ideal for edge applications.

![LlaMamba scaling](assets/llamamba-scaling.png)


## Rene in MLX
![Language Model](assets/lm-demo.gif)
dockershit 0.1.3
dockerfile shell interactive terminal

# docker sh -it

```txt
BUILDING DOCKERIFLES OVER AND OVER AGAIN WITH NO FEEDBACK AT ALL IS LIKE WEARING
THREE CONDOMS I'M TOO OLD FOR THIS SHIT I NEED TO TOUCH IT AND FEEL WHAT'S GOING
ON IN THERE OR I'LL LOSE INTEREST WHY CAN'T WE JUST CONNECT AND GET FEEDBACK AND
A RHYTHM GOING INSTEAD OF ALL THIS STOPPING AND STARTING IT'S REALLY OFF-PUTTING
AND NOT GOOD FOR ANYONE WHY NOT CONNECT TO THE CONTAINER THEN TYPE YOUR COMMANDS
IN AND WHEN THEY WORK THEY GET ADDED TO THE dOCKERFILE AND IF THEY DON'T THEY GO
IN AS COMMENTS OR SOMETHING AND IN THE BACKGROUND IT'S REBUILDING YOUR IMAGE AND
RECONNECTING READY FOR THE NEXT COMMAND OH AND HAVE IT WORK WITH THINGS LIKE add
AND copy AND STUFF THEN WHEN YOU'VE ACTUALLY GOT SOMETHING THAT WORKS YOU CAN GO
AND EDIT IT INTO SOMETHING THAT LOOKS MORE LIKE AN ACTUAL dOCKERFILE RATHER THAN
TRYING TO DO EVERYTHING UP-FRONT BEFORE YOU EVEN KNOW IF IT'S GONNA WORK INSTEAD
OF COMMUNICATING BY TELEGRAM MAYBE I SHOULD INSTALL DOCKERSHIT AND USE THAT YEAH
ITS PRETTY EASH YOU JUST TYPE `uvx dockershit` APPARENTLY AND IT'LL BE READY FOR
USE IN UNDER A SECOND AND WILL MOSTLY WORK BUT MIGHT BE BUGGY BECAUSE ITS NEWISH
AND THE DEVELOPER WROTE IT IN ANGER AND DOESN'T SEEM TO TAKE IT SERIOUSLY BUT IT
IS WORTH A TRY BECAUSE IF YOU WASTE TIME HERE AT LEAST IT IS WASTED DIFFERENTLY.
```

## Usage

Quickest way is run it in `uv` (either `pip install uv` or follow
[their instructions](https://github.com/astral-sh/uv)). Or use
`pip install dockershit` or `pipx dockershit`. It's on pypi.

### ⚠️ IT EDITS DOCKERFILES SO USE SOURCE CONTROL ⚠️

By default it'll create or append to a `Dockerfile` in your pwd. Earlier
versions also delete stuff, current ones might comment things out. Don't say
you weren't warned.

```bash
uvx dockershit ubuntu:latest
```

* type some commands, then `exit` or `quit`
* look in your pwd for a `Dockerfile`, notice the `RUN` lines - they're the
  commands that worked (zero exit code)
* commands that failed or made no changes are commented out
* arrow keys and ctrl+r work, history is in `Dockerfile.history`
* commands starting with a space don't get added to the file, but they do go to
  the .history file
* comments e.g. `# wtf delete the above` go to the `Dockerfile` unless they
  start with a space i.e. ` # subscribe and like, like and subscribe`
* `ADD`, `COPY` and other docker shit get added too, and the image is rebuilt
  between each command
* if a command fails, you'll get a commented out line instead
* `cd` changes your `WORKDIR`, and `WORKDIR` changes your `cd`
* use `--debug` if you want to see it rebuilding
* if you break your `Dockerfile` it'll exit (it rebuilds after every command)
  and currently deletes the broken line
* your Dockerfile and its history are excluded from the context
* you can use it with pipe like `cat whatever | dockershit`
* yeah it runs everything twice, which is an embarrassment - in future I'll make
  it just run in docker, but pull requests are welcome