Skip to main content

🎵 Note: I have been making new releases frequently. Make sure your package is up-to-date!

⚠️ Warning: This library is in active early development! No guarantees are made for backward compatibility. The library is NOT production-ready.

Is this for me?

This library is mostly designed for me (hence the name), but they might be helpful for you too!

Here are some questions to ask yourself when considering whether to use this library:

  • Do you interact with LLMs? (Currently, only Anthropic LLMs are supported).
  • Do you value conciseness?
  • Are you writing non-production prototype code, where 1, occassional bugs and behavioral changes are acceptable, and 2, developer ergonomics are more important than performance?
    • Note: This library strongly assumes this use-case! e.g. alana.gen actually writes to the console by default (you can disable this with loud=False).
  • Do the features appeal to you?

Philosophy:

  • Programming is too slow! This is doubly true when you're interacting with LLMs. By building nice utilities with sane defaults, I hope to speed up my (and maybe your) workflow.
  • I make trade-offs to speed up the developer experience:
    • I do not try hard to anticipate future upstream API changes. I'm also ok with breaking backward compatibility to make my functions more concise and more usable.
    • Usability > Principles. While I don't relish in it, I'm ok with breaking conventions designed for large production libraries if it speeds up programmers who use alana. The priority is to make the library intuitive and fast.
    • I don't try to serve every use-case.
  • Simplicity is key. This library strives to be readable and straightforward.

Motivating Examples:

(I tested these, and tried to make sure my code was idiomatic in all cases. Sorry if I messed up! Please report any issues to h i ( a t ) [pip package name for this library] dot computer.)

Continuing a list of messages using Anthropic API (adapted from Anthropic API documentation:

import anthropic
from anthropic.types import MessageParam
messages = [
  MessageParam(
    role="user",
    content="Hello, Claude!"
  ),
]
output_text = anthropic.Anthropic().messages.create(
    model="claude-3-opus-20240229",
    max_tokens=1024,
    messages=messages
).content[0].text
messages.append(
  MessageParam(
    role="assistant",
    content=output_text
  )
)
print(messages)  # [{'role': 'user', 'content': 'Hello, Claude!'}, {'role': 'assistant', 'content': "Hello! It's nice to meet you. How are you doing today?"}]

Equivalent alana code:

import alana
messages = []
alana.gen(user="Hello, Claude!", messages=messages, model="opus", max_tokens=1024)
print(messages)  # [{'role': 'user', 'content': 'Hello, Claude!'}, {'role': 'assistant', 'content': "Hello! It's nice to meet you. How are you doing today?"}]

Also, equivalent alana code thanks to defaults:

import alana
messages = []
alana.gen(user="Hello, Claude!", messages=messages)
print(messages)  # [{'role': 'user', 'content': 'Hello, Claude!'}, {'role': 'assistant', 'content': "Hello! It's nice to meet you. How are you doing today?"}]

Metadata

Release files for alana 0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for alana 0.0.10
File Size Uploaded
alana-0.0.10.tar.gz 15.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for alana 0.0.10
File Interpreter ABI Platform
alana-0.0.10-py3-none-any.whl Python 3 none any Details

Total release size: 34.6 kB

Release files / alana-0.0.10.tar.gz

Download URL alana-0.0.10.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1ce16e6a57472f0edc90d6eab073aac1cbfe3f969883aa73414fe362ae88de97
BLAKE2b-256 checksum
How to use checksums
d4b62f78996d5b6a20e090c797b2fe56803d22733f2a12070077f1c165549c6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.19

Release files / alana-0.0.10-py3-none-any.whl

Download URL alana-0.0.10-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c81909045a57aceabf42ca2241daf567151af5421db1932401911a08ed39c09
BLAKE2b-256 checksum
How to use checksums
418e82449c41221536e887941697deb18c87ebb89500b96b1f8c038a1513ea43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.0.10 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page