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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_llms_lmstudio-0.4.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for llama_index_llms_lmstudio-0.4.1.tar.gz
Algorithm Hash digest
SHA256 d2361c0b8f5261bdcc3d3423a794e489fa3125a1039305835616c99d1ec20c33
MD5 cf67daa32c32f344f946263066bef342
BLAKE2b-256 ab199836e26bda078fa97405dea431775c2b0c338b1bbda317af09f169a6a554

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_llms_lmstudio-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4d6d5c2e6102291f1ca2613c2f9309dfb4938b0cdc72b0acfbc9b3251bbbf8f7
MD5 f528afbb69909277654656b1badeca36
BLAKE2b-256 bdfa6191cd90c510bc39d472765f3b5aea5a3ff8ad0cc6d3c425779eecb4483a

See more details on using hashes here.

Supported by

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