Skip to main content

Python Runtime Inline AI Calls

Project description

relyonai

Python Runtime Inline AI Calls

  • 🤖 AI language extension.
  • 📉 Reduces code size.
  • 🐍 Can use python runtime objects.
  • 💿 Caches calls, so it's fast on re-runing.
  • ✅ Fixes mistakes internallly.
  • 🎁 Saves runtime context for reusing.
  • ⭐️ Uses Few-Shot and COT under the hood.

Warning
See Reflections.

Usage

pip install relyonai
export OPENAI_API_KEY=...
from relyonai import ai
f = ai('get print hello world func')
f()
from relyonai import config
config.model = 'gpt-4'
config.clear_cache()

See tests for more.

Reflections

Although the idea is working to some extent, it remains largely impractical for the time being. It falls short in a few crucial areas:

  • Reliability and Consistency: The code that's being generated is not consistently accurate, with minor prompt modifications often leading to significant changes.
  • Controllability: GPT-3.5, which was the primary model for the development of 0.1, practically ignores system messages and often fails to follow few-shot examples, even for simple calls.
  • Privacy and Security: This conserns could be largely mitigated by clever prompting and potentially runtime sandboxing (like patching Python's open call or something similar).

GPT-4 is expected to be a major leap over all axes with usable clever system messages and better Few-Shot/COT, but it needs to become publicly accessible, approximately 5x cheaper and roughly 2x faster to be practical for this task.

0.2 Plans

Note
this is a rough draft

  • improve quality
    • gpt-4: new system prompt and better cot
    • more tests + add reliability tests
    • include invocation context (ai, ±5 above/below exprs)
    • include project info / files / pip / hardware / os / time / etc.
    • final result check
    • different prompt for different py versions
    • other runtimes: bash, remote, c++, browser, etc.
    • bootstrap the package itlsef (just for the fun of it)
  • better introspection
    • rich dialogue printing (+spinner)
    • much better error handling
    • view source code/doc
    • more granular sessions (trees)
  • advanced caching
    • redis
    • limit size (up to ~20mb)
    • save pre-compiled code
  • async
    • aai
    • agpt
    • aemb

License

MIT

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

relyonai-0.1.2.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

relyonai-0.1.2-py3-none-any.whl (47.8 kB view details)

Uploaded Python 3

File details

Details for the file relyonai-0.1.2.tar.gz.

File metadata

  • Download URL: relyonai-0.1.2.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for relyonai-0.1.2.tar.gz
Algorithm Hash digest
SHA256 23d79a72f694376598688c51303a618634809327a9d66ef4fc377bfd770a3825
MD5 d0d60fe61e8a25eecff0935861a9a71c
BLAKE2b-256 8cc2ef973c9a8f9f9738c80d8bc829df2f91323b4092cb99596ee8def2d1a0ae

See more details on using hashes here.

File details

Details for the file relyonai-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: relyonai-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 47.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for relyonai-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6e3a3f2667167678c67ec34f3ef744db739094f6a6d9b6692f1a626089353fd0
MD5 9f28c766f67cea5a2d46e60b22213ca7
BLAKE2b-256 8748b9e2f2b7f80c8def98e340bebcd9a12059b26c233c11b28b254cdf84d451

See more details on using hashes here.

Supported by

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