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.3.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

  • Download URL: llama_index_llms_lmstudio-0.3.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0

File hashes

Hashes for llama_index_llms_lmstudio-0.3.0.tar.gz
Algorithm Hash digest
SHA256 1abd9e68862d6bd9083e5fee05def6d67e5be9b663718587524d922286d8aa06
MD5 26a4138d37d5d1a6b16a10af3c93c473
BLAKE2b-256 9f301e9d651cb00a62f4f4733e2076af489791faa3e76fb8187f51f9df50d8f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_llms_lmstudio-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09c71ad49bd63c75630dabd0daebecb11b824ed23016a394a4e5f6f25f189ab7
MD5 ad05cce01a7bf1c0d3a326d09e824996
BLAKE2b-256 8192a0524bc8deaf29fd3ac21a98426d1ea5c8ce2fdeb97112730bdeeecda177

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