Phi 3.1 Mini 128k

Microsoft

phi3

Microsoft's latest Phi Mini model supports a whopping context length of 128k tokens in a small size, offering extremely long chats for cheap.

Model info

Model

Phi 3.1 Mini 128k

Author

Microsoft

Arch

phi3

Parameters

3.8B

Size on disk

about 2.39 GB

Format

gguf

Download and run Phi 3.1 Mini 128k

Open in LM Studio to view download options

Use Phi 3.1 Mini 128k in your code

💡 LM Studio needs to be installed and run at least once for this to work. Don't have it yet? Get it here.

CLI Bootstrap

npx lmstudio install-cli # (only needed once)

Model Load

lms load lmstudio-community/phi-3.1-mini-128k-instruct-gguf
Alternatively, load the model in the LM Studio app.

Use Phi 3.1 Mini 128k via an OpenAI-like API

Reuse your existing OpenAI client code and point it to LM Studio instead.

Python example
# Example: reuse your existing OpenAI client code
from openai import OpenAI

# Point to the local server
client = OpenAI(base_url="http://localhost:1234/v1", 
                api_key="lm-studio") # not used

completion = client.chat.completions.create(
  model="lmstudio-community/phi-3.1-mini-128k-instruct-gguf",
  messages=[
    {"role": "system", "content": "Always answer in rhymes."},
    {"role": "user", "content": "Introduce yourself."}
  ],
  temperature=0.7,
)

print(completion.choices[0].message)

Develop

Learn more