A mastodon reader client that uses embeddings to present a consolidated view of my mastodon timeline
Project description
Fossil, a Mastodon Client for Reading
A mastodon client optimized for reading, with a configurable and hackable timeline algorithm powered by Simon Wilison's llm tool. Try making your own algorithm!
Sneak peek:
Installing & Running
From PyPi
I highly suggest not installing any Python app directly into your global Python. Create a virtual environment:
python -m venv fossil
And then activate it (see here)
source fossil/bin/activate
Alternatively, use pipx
:
pip install pipx
pipx install fossil-mastodon
From Source
Clone this repo:
git clone https://github.com/tkellogg/fossil.git
And then cd fossil
to get into the correct directory.
Configure the .env
file
Before that, you'll need a .env
file with these keys:
ACCESS_TOKEN=
Alternatively, you can set them as environment variables. All available keys are here:
Variable | Required? | Value |
---|---|---|
OPENAI_API_BASE | no | eg. https://api.openai.com/v1 |
MASTO_BASE | no? | eg. https://hackyderm.io |
ACCESS_TOKEN | yes | In your mastodon UI, create a new "app" and copy the access token here |
Connecting to Mastodon
To get MASTO_BASE
and ACCESS_TOKEN
:
- Go to Mastodon web UI
- Preferences -> Development
- Click "New Application"
- Set the name
- Set "Redirect URI" to
urn:ietf:wg:oauth:2.0:oob
- Set scopes to all
read
andwrite
(contribution idea: figure out what's strictly necessary and send a pull request to update this) - Click Submit
- Copy your access token into
ACCESS_TOKEN
in the.env
file. - Set
MAST_BASE
. You should be able to copy the URL from your browser and then remove the entire path (everything after/
, inclusive).
Configure Models
Models can be configured via llm
. For example, here's how to set your OpenAI API key, which gives you access to OpenAI models:
$ llm keys set openai
Enter key: ...
Run the server
If you installed from PyPi:
uvicorn --host 0.0.0.0 --port 8888 fossil_mastodon.server:app
If you installed from source:
poetry run uvicorn --host 0.0.0.0 --port 8888 --reload fossil_mastodon.server:app
If you're working on CSS or HTML files, you should include them:
poetry run uvicorn --host 0.0.0.0 --port 8888 --reload --reload-include '*.html' --reload-include '*.css' fossil_mastodon.server:app
(Note the --reload
makes it much easier to develop, but is generally unneccessary if you're not developing)
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
Hashes for fossil_mastodon-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fbc65174e247a8a6d2103caf45ad7fd3bb45812dc9191149a307ddf3202f2c8 |
|
MD5 | ac2b9f76f621bb1b11b7a3981d0ad94d |
|
BLAKE2b-256 | 054fb64926916186923f6c7deaac713814b04167edfe2e5e7d2aec160cfeef69 |