Skip to main content

llama-index llms lmstudio integration

Project description

LlamaIndex Llms Integration: Lmstudio

pip install llama-index-llms-lmstudio

Usage Steps

  1. Open LM Studio App and go to the Local Server Tab
  2. In the Configuration settings, enable Apply Prompt Formatting
  3. Load the model of your choice
  4. Start your server
from llama_index.llms.lmstudio import LMStudio

llm = LMStudio(
    model_name="Hermes-2-Pro-Llama-3-8B",
    base_url="http://localhost:1234/v1",
    temperature=0.7,
)

messages = [
    ChatMessage(
        role=MessageRole.SYSTEM,
        content="You an expert AI assistant. Help User with their queries.",
    ),
    ChatMessage(
        role=MessageRole.USER,
        content="What is the significance of the number 42?",
    ),
]

response = llm.chat(messages=messages)
print(str(response))

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

llama_index_llms_lmstudio-0.2.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file llama_index_llms_lmstudio-0.2.0.tar.gz.

File metadata

  • Download URL: llama_index_llms_lmstudio-0.2.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0

File hashes

Hashes for llama_index_llms_lmstudio-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5788b0728ca49a142e92761d7dbff32e52381e558ffeff46c2b8d9dba7370b52
MD5 ee3b95d4e9c429840a21fb05d0c0bb59
BLAKE2b-256 5f2742ceb5df12572bf615594093c516f78e8dfb14984de36286e753d43fdde2

See more details on using hashes here.

File details

Details for the file llama_index_llms_lmstudio-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_llms_lmstudio-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36fc01b5693aba57b1dac75e4ae4d78c4a43741b41781becf5725b9e3df78061
MD5 c718a1981580245c9c6d3f6c119aceeb
BLAKE2b-256 f6a1c18c26bd5d07f0a7ae621e24d1cb473151027d5074c2695931dc38029570

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