llama-index llms opea integration
Project description
LlamaIndex Llms Integration: OPEA LLM
OPEA (Open Platform for Enterprise AI) is a platform for building, deploying, and scaling AI applications. As part of this platform, many core gen-ai components are available for deployment as microservices, including LLMs.
Visit https://opea.dev for more information, and their GitHub for the source code of the OPEA components.
Installation
- Install the required Python packages:
%pip install llama-index-llms-opea
Usage
from llama_index.core.llms import ChatMessage
from llama_index.llms.opea import OPEA
llm = OPEA(
model="meta-llama/Meta-Llama-3.1-8B-Instruct",
api_base="http://localhost:8080/v1",
temperature=0.7,
max_tokens=256,
additional_kwargs={"top_p": 0.95},
)
# Complete a prompt
response = llm.complete("What is the capital of France?")
print(response)
# Stream a chat response
response = llm.stream_chat(
[ChatMessage(role="user", content="What is the capital of France?")]
)
for chunk in response:
print(chunk.delta, end="", flush=True)
All available methods include:
complete()stream_complete()chat()stream_chat()
as well as async versions of the methods with the a prefix.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_llms_opea-0.1.2.tar.gz.
File metadata
- Download URL: llama_index_llms_opea-0.1.2.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a658abf3c4618b3bb7ec46e57d929954c6c45b63828bd3ef0bbfdc2a3695eaf
|
|
| MD5 |
7e9c6f1496ebe72978a5d14018baccef
|
|
| BLAKE2b-256 |
3ed95cf21f18fb3af312b89e64521e15cde936da7b0433ca5a2bca65461f41a1
|
File details
Details for the file llama_index_llms_opea-0.1.2-py3-none-any.whl.
File metadata
- Download URL: llama_index_llms_opea-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3d2762c1a306486f24f57a2debc26ac2dd291d1aa201ab338bc9faf33dae956
|
|
| MD5 |
241d884cfe76ec5e23a50640137f6fca
|
|
| BLAKE2b-256 |
17387e2fa1e37b4c2785c5ef60ee20393d4b708d86d21b66f0c174de98606b28
|