Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bilbystats-0.2.0.tar.gz (6.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bilbystats-0.2.0-py3-none-any.whl (6.7 MB view details)

Uploaded Python 3

File details

Details for the file bilbystats-0.2.0.tar.gz.

File metadata

  • Download URL: bilbystats-0.2.0.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

Hashes for bilbystats-0.2.0.tar.gz
Algorithm Hash digest
SHA256 04d37db9cbeedb6be4950bcf7c481234b3b0ee9e3259a5910f7ee9d4e7a3b8fa
MD5 50ed216283af71895eb7e58128660b6c
BLAKE2b-256 b6fa020ce0b7062d47a9b892141bb18effd820c5e4f36ead2a49adbd4ff964a2

See more details on using hashes here.

File details

Details for the file bilbystats-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: bilbystats-0.2.0-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

Hashes for bilbystats-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c775df61cf04afd5b7d4a4b5dd494c75950d8bd05b82b86ad5921676385093e2
MD5 f0d45836dd47af4def26c7590cfeeb99
BLAKE2b-256 476b473a01a6c79e6141f5a72922600e0fbdc4be001c552ef45a6a9d17a957c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page