Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 15 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: maxsimd
name: CI

on:
push:
Expand All @@ -7,7 +7,7 @@ on:
branches: [ main ]

jobs:
maxsimd:
test:
name: Build & Test (Rust + Python)
runs-on: ubuntu-latest

Expand All @@ -32,7 +32,7 @@ jobs:
with:
python-version: "3.13"

# 5. Run Rust Cargo Tests (with dev features enabled for MKL/BLAS)
# 5. Run Rust Cargo Tests
- name: Run Cargo Tests
run: |
cargo test --verbose
Expand All @@ -43,36 +43,26 @@ jobs:
python -m pip install --upgrade pip
pip install maturin numpy pytest

# 7. Build and install maxsimd CPython extension via Maturin
- name: Build and install maxsimd (Release)
# 7. Build and install BBQ package via pip
- name: Build and install BBQ (Release)
run: |
pip install .

# 8. Check version and exported functions
- name: Verify maxsimd version and exports
# 8. Check BBQ version and CLI
- name: Verify BBQ version and CLI
run: |
python -c "
import maxsimd
version = getattr(maxsimd, '__version__', 'N/A')
import bbq
version = getattr(bbq, '__version__', 'N/A')
print('=' * 50)
print(f'MaxSimD Version: {version}')
print('Exported functions:', [item for item in dir(maxsimd) if not item.startswith('__')])
print(f'BBQ Version: {version}')
print('=' * 50)
assert version != 'N/A'
"
bbq --version

# 9. Run a fast MaxSim computation smoke test
- name: Run MaxSim Python smoke test
# 9. Run Python unit tests
- name: Run Pytest test suite
run: |
python -c "
import maxsimd
import numpy as np
pytest

# 32 query tokens, 256 document tokens, 128 dimension
q = np.random.randn(32, 128).astype(np.float32)
d = np.random.randn(256, 128).astype(np.float32)

score = maxsimd.maxsim(q, d)
print('Calculated MaxSim score successfully:', score)
assert len(score) == 1
assert isinstance(score[0], float)
"
11 changes: 3 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "maxsimd"
version = "0.1.3-alpha"
version = "0.1.4-alpha"
edition = "2024"
homepage = "https://github.com/cmd-HMN"
description = "This packages is the simd implementations of max sim function for faster calculation"
Expand All @@ -19,20 +19,15 @@ rust.unsafe_code = "allow"

[dependencies]
pyo3 = "0.29.0"
rayon = "1.10"
rayon = "1.10"
pyo3-stub-gen = "0.23.0"
intel-mkl-src = { version = "0.8.1", optional = true, features = ["mkl-static-lp64-seq"] }
libc = {version = "0.2", optional = true}
# [dependencies.intel-mkl-src]
# version = "0.8.1"
# optional = true
libc = { version = "0.2", optional = true }

[dev-dependencies]
criterion = "0.8.2"
approx = "0.5"
rand = "0.10.2"


[[bin]]
name = "stub"
path = "rust-core/_bin/stub.rs"
Expand Down
34 changes: 26 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ rag_top_k: 3
Launch the document indexing server. It will monitor `data/watch/` for new PDF files and automatically compute embeddings:

```bash
# Using the bbq CLI command
bbq server --config config.yaml

# Or via Python module
python -m bbq.src.main server --config config.yaml
```

Expand All @@ -115,14 +119,32 @@ python -m bbq.src.main server --config config.yaml
Search indexed documents from the command line:

```bash
# Query top 3 matching pages
python -m bbq.src.main query "What was the operating margin in Q3?" --top-k 3
# Fetch top 10 matching pages (prints ASCII BBQ banner on run)
bbq client "What was the operating margin in Q3?"
# Or: python -m bbq.src.main query "What was the operating margin in Q3?"

# Fetch without ASCII logo banner
bbq client --without-logo "What was the operating margin in Q3?"

# Query with Gemini Multimodal RAG (generates grounded answer from top 3 page images)
# Query with Gemini Multimodal LLM (displays live cooking spinner and multimodal answer)
export GEMINI_API_KEY="your-gemini-api-key"
python -m bbq.src.main query "Summarize the revenue growth" --top-k 3
bbq client "Summarize the revenue growth" --use-llm

# Continuous interactive query prompt loop (--infinite / -inf)
bbq client --infinite
# Or with LLM cooking enabled:
bbq client --infinite --use-llm

# Run directly via the client module
python -m bbq.src.client --infinite --use-llm
```

In `--infinite` mode, an interactive prompt (`bbq[query] >> `) appears for continuous querying:
- Type any query to search.
- Type `help` or `?` to show the commands menu.
- Type `clear` or `cls` to clear the terminal screen.
- Type `q`, `quit`, or `exit` (or `Ctrl+C`) to quit.

If no Gemini API key is provided or the API is unavailable, the client automatically displays the matching document pages without crashing.

### 4. Python API Usage
Expand Down Expand Up @@ -207,7 +229,3 @@ We express our sincere thanks to the original authors and maintainers for their
For full project lineage, paper citations, and intellectual property notices, see [ABOUT.md](ABOUT.md).

---

## Disclaimer

This project, its documentation, and parts of its codebase and benchmarks were developed with the assistance of AI tools. As an evolving early-stage project, this README and documentation may contain preliminary assumptions or specifications that are actively being refined. Future commits will continuously audit, validate, and update these details to ensure ongoing accuracy, correctness, and benchmarking rigor. No warranties or guarantees of fitness for a particular purpose are provided.
5 changes: 5 additions & 0 deletions bbq/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""BBQ package."""

from bbq.src.common.version import __version__

__all__ = ["__version__"]
2 changes: 1 addition & 1 deletion bbq/maxsimd/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ def maxsim(
**kwargs: typing.Any,
) -> builtins.list[builtins.float]: ...

__version__ = "0.1.3-alpha"
__version__ = "0.1.4-alpha"
4 changes: 2 additions & 2 deletions bbq/src/client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from bbq.src.client.client import BBQClient, get_local_pdf_page_image
from bbq.src.client.gemini import GeminiClient
from bbq.src.terminal.tui import print_bbq

__all__ = ["BBQClient", "GeminiClient", "get_local_pdf_page_image"]

__all__ = ["BBQClient", "GeminiClient", "get_local_pdf_page_image", "print_bbq"]
Loading
Loading