Python Packages of functions for performing stats for bilby
Project description
BilbyStats
A collection of statistical and machine learning functions for use in the Bilby pipeline
Install the package
Pip installation
pip install bilbystats
Alternative: local installation
To pull the repo run
git clone --depth=1 https://github.com/bilbyai/bilbystats/
Navigate to the root directory of the package and run
uv pip install .
or just
pip install .
if you don't have uv install.
Set up API keys
API keys must be added in order to call LLMs. To do so they must be added to the environment. The simplest way to do so is to add lines of the following form to your .bashrc or .zshrc file.
export OPENROUTER_API_KEY=exampleapikey
export OPENAI_API_KEY=exampleapikey
export CLAUDE_API_KEY=exampleapikey
Where you should replace exampleapikey with the corresponding API key in each case.
Importing the package
Then the package can be imported from within python via e.g.
import bilbystats as bs
Setting local defaults
In order to set local defaults. E.g. for checkpoint saving etc. You'll need to navigate to
cp bilbystats/defaults/local_defaults_example.env bilbystats/defaults/local_defaults.env
and then change the default parameters and reinstall the package.
Run local LLMs using Ollama
If you'd like to use the Ollama functions which allow you to call LLMs on your local machine you'll need to install Ollama. Once you've installed ollama you can download LLMs such as llama3.2
ollama run llama3.2
or deepseek-r1:7b
ollama run deepseek-r1:7b
See https://ollama.com/search for a full list of the available models.
To call the LLM programmatically using bilbystats you can run
bs.llm_api('test call', 'you are an llm', 'llama3.2')
or
bs.llm_api('test call', 'you are an llm', 'deepseek-r1:7b')
Or in general use the model name in any llm related function such as bs.translate.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bilbystats-0.2.5.tar.gz.
File metadata
- Download URL: bilbystats-0.2.5.tar.gz
- Upload date:
- Size: 6.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2d601bb413775877a36962eae4537ad4e11f83b735986b7d5a6b0e9f051193c
|
|
| MD5 |
3ac93d40e46f63af9087aa334ddd9d2d
|
|
| BLAKE2b-256 |
bbf4067eeb40188843522561583a20bb5b05ac3c3dd64a22321821c37dc47c0b
|
File details
Details for the file bilbystats-0.2.5-py3-none-any.whl.
File metadata
- Download URL: bilbystats-0.2.5-py3-none-any.whl
- Upload date:
- Size: 6.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ca399f5396736cec5693d29e53f02c5ec3045542d422a3229d5b83af7c09dde
|
|
| MD5 |
8d1a75e478292ff4ffbcc37eb8f7e339
|
|
| BLAKE2b-256 |
5b516ded76b75886e6e75129f38e5f7d9fa8eb259d44e4469cd0f5e12a82faf0
|