Skip to content

Conversation

@tomdyson
Copy link
Owner

  • Adds llm and llm-openai as dependencies.

  • Refactors answer() and streaming_answer() to use llm.get_model() and model.chat() instead of openai.ChatCompletion.

  • Updates README, Dockerfile, and deploy_instructions() to reflect new dependencies, env var config (MODEL, API keys), and the continued need for OPENAI_API_KEY for embeddings.

- Adds llm and llm-openai as dependencies.

- Refactors answer() and streaming_answer() to use llm.get_model() and model.chat() instead of openai.ChatCompletion.

- Updates README, Dockerfile, and deploy_instructions() to reflect new dependencies, env var config (MODEL, API keys), and the continued need for OPENAI_API_KEY for embeddings.
@tomdyson tomdyson requested a review from Copilot April 21, 2025 09:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the chat answer functions to use the new llm library and updates relevant dependencies and documentation to reflect the changes.

  • Replaces OpenAI ChatCompletion with llm.get_model() and model.chat() in answer() and streaming_answer().
  • Adds llm and llm-openai dependencies and updates deployment instructions and the README accordingly.

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
pyproject.toml Added new dependencies ("llm" and "llm-openai") to support chat models.
microllama/init.py Refactored answer functions to leverage the llm library; removed openai.ChatCompletion.
README.md Updated API key instructions and deployment notes to reflect the new changes.
Files not reviewed (1)
  • microllama/Dockerfile: Language not supported
Comments suppressed due to low confidence (1)

microllama/init.py:11

  • The code uses inspect.cleandoc() in answer() and streaming_answer() but there's no import for the 'inspect' module. Please add 'import inspect' near the other import statements.
from typing import Optional, Union

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants