Skip to content

Conversation

@Harryki
Copy link

@Harryki Harryki commented Sep 29, 2025

Added setup doc for open ai integration

Related Issue

N/A

Description

though docs/CONFIGURING.md has addressed some key points of using open ai as provider, I thought it'd be helpful to provide more detailed guide how to use open ai.

Type

  • Bug Fix
  • Feature Enhancement
  • Documentation Update
  • Code Refactoring
  • Other (please specify):

Proposed Changes

  • added new section "Open AI Integration" at SETUP.md

Screenshots / Code Snippets (if applicable)

image

How to Test

N/A

Checklist

  • The code compiles successfully without any errors or warnings
  • The changes have been tested and verified
  • The documentation has been updated (if applicable)
  • The changes follow the project's coding guidelines and best practices
  • The commit messages are descriptive and follow the project's guidelines
  • All tests (if applicable) pass successfully
  • This pull request has been linked to the related issue (if applicable)

Additional Information

N/A


Summary by cubic

Added an OpenAI setup guide to SETUP.md to configure the backend for using OpenAI as the LLM and embedding provider. Includes example model names and environment keys so users can quickly switch from local Ollama to OpenAI.

  • Migration
    • Set env vars in apps/backend/.env: LLM_API_KEY, EMBEDDING_API_KEY, LLM_PROVIDER=openai, EMBEDDING_PROVIDER=openai, LL_MODEL, EMBEDDING_MODEL.
    • Example models: gpt-4.1-2025-04-14 and text-embedding-3-large.
    • Restart with make run-dev; Ollama is no longer needed.

Summary by CodeRabbit

  • Documentation
    • Added an "OpenAI Integration" section to setup with prerequisites (OpenAI API key, model names), example environment variables, and instructions to restart/run the dev server.
    • Clarified the app connects directly to OpenAI’s API (no local Ollama service required).

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 29, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds an "OpenAI Integration" section to SETUP.md describing prerequisites (OpenAI API key, model names), an example apps/backend/.env block, env key update steps, and a note to re-run the dev server; clarifies the system calls OpenAI's API directly instead of using a local Ollama.

Changes

Cohort / File(s) Summary
Documentation: OpenAI integration
SETUP.md
Inserted a new "OpenAI Integration" section with prerequisites (API key, model names like GPT-4.1 and text-embedding-3-large), sample apps/backend/.env block, instructions to update env keys and re-run make run-dev, and removed dependence on local Ollama by documenting direct OpenAI API usage.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

I thump my paws, excitedly keen,
New keys in .env—so crisp and clean.
No Ollama to brew, no local stew,
We hop to OpenAI, straight and true.
make run-dev hums—carrots deployed anew. 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "added setup doc for open ai integration" directly describes the main change in this PR, which is adding a new "OpenAI Integration" section to SETUP.md with prerequisites, environment configuration, and instructions for using OpenAI's API. The title accurately captures that this is a documentation addition focused on OpenAI integration setup. While the title uses lowercase formatting and could be more polished (e.g., "Add setup documentation for OpenAI integration"), it is clear, specific, and fully related to the changeset's primary purpose.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e80c13f and 5ee9004.

📒 Files selected for processing (1)
  • SETUP.md (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-29T21:17:22.009Z
Learnt from: Harryki
PR: srbhr/Resume-Matcher#509
File: SETUP.md:283-283
Timestamp: 2025-09-29T21:17:22.009Z
Learning: In the Resume-Matcher project, the environment variable for the LLM model name is `LL_MODEL`, not `LLM_MODEL`. This is consistently used throughout the backend codebase in apps/backend/app/core/config.py and all provider implementations.

Applied to files:

  • SETUP.md
🔇 Additional comments (4)
SETUP.md (4)

279-285: Good use of placeholder text for API keys.

The example correctly uses placeholder text (YOUR_OPEN_AI_API_KEY) rather than exposing real credentials, which is appropriate for documentation.

Note: The example shows the same API key for both LLM_API_KEY and EMBEDDING_API_KEY. While this is valid (both services use the same OpenAI account key), consider adding a brief comment explaining this to avoid user confusion.

Optionally clarify:

 ### Update environment keys at `./apps/backend/.env` 
 For example if you want to use gpt4.1 with text embedding 3 large append below at the end of `.env` file
 ```env
+# Note: Use the same OpenAI API key for both LLM and embedding services
 LLM_API_KEY="YOUR_OPEN_AI_API_KEY"
 EMBEDDING_API_KEY="YOUR_OPEN_AI_API_KEY"
 LLM_PROVIDER="openai"
 EMBEDDING_PROVIDER="openai"
 LL_MODEL="gpt-4.1-2025-04-14"
 EMBEDDING_MODEL="text-embedding-3-large"

---

`287-290`: **LGTM: Clear restart instructions.**

The instruction to restart the development server is clear and uses the existing `make run-dev` command consistently referenced throughout the document.

---

`292-292`: **LGTM: Clear explanation of OpenAI vs Ollama usage.**

The note effectively clarifies that switching to OpenAI removes the Ollama dependency, which is helpful for users deciding between providers.

---

`271-274`: <!-- [scratchpad]
[task review_file_1/1 review_segment_2/5 verify_model_name complete]
[observations]
- OpenAI uses dated snapshot format with both -MMDD and -YYYY-MM-DD formats
- The model name "gpt-4.1-2025-04-14" follows the -YYYY-MM-DD dated snapshot convention
- This is a valid and correct model naming format
- GPT-4.1 was released on April 14, 2025, matching the date in the snapshot name
[analysis]
- My initial concern about the model name was incorrect
- The documentation is technically accurate regarding the model name
- The security concern about API key handling remains the primary valid issue
- The "e.g" vs "e.g." inconsistency is minor but should be noted
- Given that the model name is correct, the main issue is the missing security guidance
[pending]
None - ready to generate final review comment
[actions]
- Generate rewritten review comment focusing on security guidance
- Downgrade severity since model name is valid
- Keep the formatting consistency note as minor
- Tag as  since security best practices should be added but aren't critical bugs
</scratchpad>

**Add security guidance for API key handling.**

The documentation instructs users to create API keys but lacks essential security warnings, which aligns with this PR's "Possible security concern" label. Consider adding an explicit security notice warning users to:
- Never commit API keys to version control
- Use environment variables (not hardcoded values)  
- Be aware that OpenAI API usage incurs costs

Minor: Inconsistent punctuation around "e.g" — line 273 uses "e.g [" while line 274 uses "e.g. [" (with period).

Suggested addition:

```markdown
### Prerequisites

> ⚠️ **Security Notice**: Never commit your API keys to version control. Always use environment variables and keep your `.env` files in `.gitignore`. Be aware that OpenAI API usage incurs costs based on tokens processed.

- OpenAI API key [create new key from here](https://platform.openai.com/api-keys)
- LLM model name you'd like to use e.g., [gpt-4.1-2025-04-14](https://platform.openai.com/docs/models/gpt-4.1)
- Embedding model name you'd like to use e.g., [text-embedding-3-large](https://platform.openai.com/docs/guides/embeddings#embedding-models)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 Security concerns

Sensitive information handling in docs:
Ensure the guide reminds users not to commit .env files and that the API key should be kept secret. Consider adding a note about .gitignore coverage and least-privilege key scopes if applicable.

⚡ Recommended focus areas for review

Branding/terminology

Use consistent branding: 'OpenAI' instead of 'Open AI' throughout headings and text to match provider naming elsewhere.

## 🤖 Open AI integration

### Prerequisites
- open ai api key [create new key from here](https://platform.openai.com/api-keys)
- LLM model name you'd like to use e.g [gpt-4.1-2025-04-14](https://platform.openai.com/docs/models/gpt-4.1)
- embedding model name you'd like to use e.g. [text-embedding-3-large](https://platform.openai.com/docs/guides/embeddings#embedding-models)

### Update environment keys at `./apps/backend/.env` 
For example if you want to use gpt4.1 with text embedding 3 large apppend below at the end of `.env` file
```env
LLM_API_KEY="YOUR_OPEN_AI_API_KEY"
EMBEDDING_API_KEY="YOUR_OPEN_AI_API_KEY"
LLM_PROVIDER="openai"
EMBEDDING_PROVIDER="openai"
LL_MODEL="gpt-4.1-2025-04-14"
EMBEDDING_MODEL="text-embedding-3-large"

re-run the server

make run-dev

Now you don't need to run ollama locally, it will communicate with open ai's api server.


</details>

<details><summary><a href='https://github.com/srbhr/Resume-Matcher/pull/509/files#diff-0040e607148899aef28b61411ebc22c4266046b5035b7bd2a45424ff2027521fR273-R285'><strong>Model/version accuracy</strong></a>

The example model 'gpt-4.1-2025-04-14' looks like a dated snapshot string; verify current, supported model IDs and whether a version suffix is needed for API calls.
</summary>

```markdown
- LLM model name you'd like to use e.g [gpt-4.1-2025-04-14](https://platform.openai.com/docs/models/gpt-4.1)
- embedding model name you'd like to use e.g. [text-embedding-3-large](https://platform.openai.com/docs/guides/embeddings#embedding-models)

### Update environment keys at `./apps/backend/.env` 
For example if you want to use gpt4.1 with text embedding 3 large apppend below at the end of `.env` file
```env
LLM_API_KEY="YOUR_OPEN_AI_API_KEY"
EMBEDDING_API_KEY="YOUR_OPEN_AI_API_KEY"
LLM_PROVIDER="openai"
EMBEDDING_PROVIDER="openai"
LL_MODEL="gpt-4.1-2025-04-14"
EMBEDDING_MODEL="text-embedding-3-large"

</details>

<details><summary><a href='https://github.com/srbhr/Resume-Matcher/pull/509/files#diff-0040e607148899aef28b61411ebc22c4266046b5035b7bd2a45424ff2027521fR276-R285'><strong>Env var names</strong></a>

Confirm that the documented env var names (LL_MODEL vs LLM_MODEL, EMBEDDING_API_KEY duplication) match the backend configuration and that a single OpenAI API key is sufficient for both LLM and embeddings.
</summary>

```markdown
### Update environment keys at `./apps/backend/.env` 
For example if you want to use gpt4.1 with text embedding 3 large apppend below at the end of `.env` file
```env
LLM_API_KEY="YOUR_OPEN_AI_API_KEY"
EMBEDDING_API_KEY="YOUR_OPEN_AI_API_KEY"
LLM_PROVIDER="openai"
EMBEDDING_PROVIDER="openai"
LL_MODEL="gpt-4.1-2025-04-14"
EMBEDDING_MODEL="text-embedding-3-large"

</details>

</td></tr>
</table>

@qodo-code-review
Copy link

qodo-code-review bot commented Sep 29, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
Use a real model name

The documentation example uses a hypothetical model name (gpt-4.1-2025-04-14).
This should be replaced with a valid, currently available OpenAI model to
prevent user errors.

Examples:

SETUP.md [283]
LL_MODEL="gpt-4.1-2025-04-14"

Solution Walkthrough:

Before:

```env
LLM_API_KEY="YOUR_OPEN_AI_API_KEY"
EMBEDDING_API_KEY="YOUR_OPEN_AI_API_KEY"
LLM_PROVIDER="openai"
EMBEDDING_PROVIDER="openai"
LL_MODEL="gpt-4.1-2025-04-14"
EMBEDDING_MODEL="text-embedding-3-large"



#### After:
```markdown
```env
LLM_API_KEY="YOUR_OPEN_AI_API_KEY"
EMBEDDING_API_KEY="YOUR_OPEN_AI_API_KEY"
LLM_PROVIDER="openai"
EMBEDDING_PROVIDER="openai"
LL_MODEL="gpt-4-turbo"
EMBEDDING_MODEL="text-embedding-3-large"




<details><summary>Suggestion importance[1-10]: 8</summary>

__

Why: The suggestion correctly identifies a non-existent model name in the documentation example, which would cause errors for users and makes the new guide misleading and unhelpful.


</details></details></td><td align=center>Medium

</td></tr><tr><td rowspan=1>Possible issue</td>
<td>



<details><summary>Correct a critical environment variable typo</summary>

___

**Correct the environment variable name from <code>LL_MODEL</code> to <code>LLM_MODEL</code> in the <code>SETUP.md</code> <br>file for consistency with other <code>LLM_*</code> variables.**

[SETUP.md [283]](https://github.com/srbhr/Resume-Matcher/pull/509/files#diff-0040e607148899aef28b61411ebc22c4266046b5035b7bd2a45424ff2027521fR283-R283)

```diff
-LL_MODEL="gpt-4.1-2025-04-14"
+LLM_MODEL="gpt-4.1-2025-04-14"
  • Apply / Chat
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a likely typo in the environment variable LL_MODEL, which should probably be LLM_MODEL for consistency with other variables. This is a critical fix for the documentation to ensure users can set up the feature correctly.

Medium
  • Update

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (1)
SETUP.md (1)

287-287: Use consistent title case for section headers.

Other section headers in the document use title case (e.g., "### Prerequisites", "### Update environment keys").

Apply this diff:

-### re-run the server
+### Re-run the Server
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8c75adf and e80c13f.

📒 Files selected for processing (1)
  • SETUP.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: cubic · AI code reviewer
🔇 Additional comments (1)
SETUP.md (1)

273-273: The model name "gpt-4.1-2025-04-14" is correct and valid.

The snapshot name "gpt-4.1-2025-04-14" is an official OpenAI model released on April 14, 2025, along with related variants gpt-4.1-mini-2025-04-14 and gpt-4.1-nano-2025-04-14. The model name follows OpenAI's standard naming convention for dated snapshots and is available via their API.

Likely an incorrect or invalid review comment.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant