Skip to main content

Bielik โ€” local Ollama chat client (CLI + web)

Project description

๐Ÿฆ… bielik

PyPI Python License Build Downloads Code style: flake8 Issues Stars Forks

Author: Tom Sapletta
License: Apache-2.0

๐Ÿ‡ต๐Ÿ‡ฑ Bielik to lokalny klient chat do Ollama z interfejsem CLI i web, stworzony specjalnie dla polskiego modelu jฤ™zykowego Bielik od Speakleash.


๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                          ๐Ÿฆ… BIELIK                             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚   ๐Ÿ–ฅ๏ธ  CLI Shell     โ”‚  ๐ŸŒ FastAPI Server   โ”‚  ๐Ÿงช Test Suite   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚ โ€ข Interactive   โ”‚โ”‚ โ”‚ โ€ข REST /chat      โ”‚ โ”‚ โ”‚ โ€ข Unit tests  โ”‚ โ”‚
โ”‚  โ”‚ โ€ข Help system   โ”‚โ”‚ โ”‚ โ€ข WebSocket /ws   โ”‚ โ”‚ โ”‚ โ€ข Mock API    โ”‚ โ”‚
โ”‚  โ”‚ โ€ข Cross-platformโ”‚โ”‚ โ”‚ โ€ข Port 8888       โ”‚ โ”‚ โ”‚ โ€ข CI/CD       โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
            โ”‚                       โ”‚                       โ”‚
            โ–ผ                       โ–ผ                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    ๐Ÿ”„ CONNECTION LAYER                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚    REST API (main)   โ”‚โ—„โ”€โ”€โ–บโ”‚   Ollama Library (fallback) โ”‚   โ”‚
โ”‚  โ”‚ โ”Œโ”€ HTTP requests     โ”‚    โ”‚ โ”Œโ”€ ollama.chat()           โ”‚   โ”‚
โ”‚  โ”‚ โ””โ”€ /v1/chat/...     โ”‚    โ”‚ โ””โ”€ Direct integration      โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   ๐Ÿฆ™ OLLAMA SERVER                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  โ”‚ ๐Ÿ“ localhost:11434 (default)                              โ”‚
โ”‚  โ”‚ ๐Ÿค– Model: bielik (Polish LLM)                             โ”‚
โ”‚  โ”‚ ๐Ÿ”— Links: Speakleash โ†’ HuggingFace โ†’ Ollama               โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿค– About Bielik Model

Bielik to przeล‚omowy polski model jฤ™zykowy stworzony przez Speakleash - fundacjฤ™ zajmujฤ…cฤ… siฤ™ rozwojem polskiej sztucznej inteligencji.

๐Ÿ”— External Dependencies & Links:

๐Ÿš€ How it Works:

  1. Bielik package connects to your local Ollama server
  2. Ollama runs the Bielik model (downloaded from HuggingFace via Speakleash)
  3. Chat interface (CLI/Web) sends queries โ†’ Ollama API โ†’ Bielik model โ†’ responses
  4. Fallback system ensures connectivity (REST API โ†’ ollama library)

๐Ÿ“Œ Features

  • ๐Ÿ–ฅ๏ธ CLI bielik โ€” interactive chat shell with smart fallback system
  • ๐ŸŒ Web server (FastAPI on port 8888):
    • POST /chat โ€” RESTful chat endpoint
    • WS /ws โ€” real-time WebSocket chat
  • ๐Ÿ”„ Dual connectivity โ€” REST API primary, ollama lib fallback
  • ๐Ÿงช Full test coverage โ€” unit tests with mocked APIs
  • ๐Ÿ”ง Developer tools โ€” Makefile automation, CI/CD ready

โš™๏ธ Installation

pip install bielik

Optional dependency (official Ollama lib):

pip install "bielik[ollama]"

๐Ÿš€ Usage

CLI

bielik

Wpisz wiadomoล›ci, zakoล„cz :exit.

Web API

uvicorn bielik.server:app --port 8888
  • POST /chat:
{"messages": [{"role":"user","content":"Hello!"}]}
  • WebSocket /ws

๐Ÿ”ง Environment Variables

  • OLLAMA_HOST โ€” default: http://localhost:11434
  • BIELIK_MODEL โ€” default: bielik

๐Ÿ“ Development

git clone https://github.com/tomsapletta/bielik.git
cd bielik
python -m venv .venv
source .venv/bin/activate
pip install -e .[ollama]

๐Ÿ“‚ Struktura

bielik/
โ”œโ”€โ”€ bielik/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ cli.py
โ”‚   โ””โ”€โ”€ server.py
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ test_cli.py
โ”‚   โ””โ”€โ”€ test_server.py
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ setup.cfg
โ”œโ”€โ”€ MANIFEST.in
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ Makefile
โ””โ”€โ”€ .github/workflows/python-publish.yml

๐Ÿ“œ License

Apache License 2.0

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

bielik-0.1.1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

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

bielik-0.1.1-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file bielik-0.1.1.tar.gz.

File metadata

  • Download URL: bielik-0.1.1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for bielik-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5b8587ada5f44be3277ccd693e48e587a8cfbe05cb9dcf613441643e7b59bd0d
MD5 04a7201c5fcbe80442e39a4329088efc
BLAKE2b-256 dbfbfd6cc7cffafa97a942a46f3aba14904519793d10e7122e78c9eecea898d0

See more details on using hashes here.

File details

Details for the file bielik-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: bielik-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for bielik-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fb66350945e37d39c72bc001c20ea64fc2c8c61f12a7f31a14f4b180f08d1675
MD5 61738c419ff9616eee9b4c37d6c09105
BLAKE2b-256 55ccd08868d8f9387fdfa69bfe228a119a2a8575cbf5b4996162c9ed86e5d9c7

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