LlamaIndex Llms Integration: Everlyai
Installation
-
Install the required Python packages:
%pip install llama-index-llms-everlyai !pip install llama-index
-
Set the EverlyAI API key as an environment variable or pass it directly to the constructor:
import os os.environ["EVERLYAI_API_KEY"] = "<your-api-key>"
Or use it directly in your Python code:
llm = EverlyAI(api_key="your-api-key")
Usage
Basic Chat
To send a message and get a response (e.g., a joke):
from llama_index.llms.everlyai import EverlyAI
from llama_index.core.llms import ChatMessage
# Initialize EverlyAI with API key
llm = EverlyAI(api_key="your-api-key")
# Create a message
message = ChatMessage(role="user", content="Tell me a joke")
# Call the chat method
resp = llm.chat([message])
print(resp)
Example output:
Why don't scientists trust atoms?
Because they make up everything!
Streamed Chat
To stream a response for more dynamic conversations (e.g., storytelling):
message = ChatMessage(role="user", content="Tell me a story in 250 words")
resp = llm.stream_chat([message])
for r in resp:
print(r.delta, end="")
Example output (partial):
As the sun set over the horizon, a young girl named Lily sat on the beach, watching the waves roll in...
Complete Tasks
To use the complete method for simpler tasks like telling a joke:
resp = llm.complete("Tell me a joke")
print(resp)
Example output:
Why don't scientists trust atoms?
Because they make up everything!
Streamed Completion
For generating responses like stories using stream_complete:
resp = llm.stream_complete("Tell me a story in 250 words")
for r in resp:
print(r.delta, end="")
Example output (partial):
As the sun set over the horizon, a young girl named Maria sat on the beach, watching the waves roll in...
Notes
- Ensure the API key is set correctly before making any requests.
- The
stream_chatandstream_completemethods allow for real-time response streaming, making them ideal for dynamic and lengthy outputs like stories.
LLM Implementation example
Metadata
Release files for llama-index-llms-everlyai 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llama_index_llms_everlyai-0.6.0.tar.gz | 5.0 kB | Without provenance | Details for llama_index_llms_everlyai-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llama_index_llms_everlyai-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for llama_index_llms_everlyai-0.6.0-py3-none-any.whl |
Total release size: 10.0 kB
Release files / llama_index_llms_everlyai-0.6.0.tar.gz
| Download URL | llama_index_llms_everlyai-0.6.0.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
45e84b02175f3278832579db72b33a56c75dbf82189c57d0beead96a56a2917d
|
|
BLAKE2b-256 checksum How to use checksums |
af322d02fd226914f761e0ef10e3f96e3cb1565d3f1336d918e214a911fa86c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / llama_index_llms_everlyai-0.6.0-py3-none-any.whl
| Download URL | llama_index_llms_everlyai-0.6.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a86b4697b3600ba2a10903ffbefac621e138e3f1548ff123a9f390b55a427d13
|
|
BLAKE2b-256 checksum How to use checksums |
bc93e371fc9f17547f3ce5f741a7a1761ea079931d68ca7edba02015f9b12ad0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for llama-index-llms-everlyai 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.