Skip to content

Conversation

aksg87
Copy link
Collaborator

@aksg87 aksg87 commented Aug 13, 2025

Description

Extends Ollama provider to recognize Hugging Face style model IDs (e.g., meta-llama/Llama-3.2-1B-Instruct), preventing API key errors when using local Ollama instances. Adds module documentation for usage patterns and supports additional model formats.

Fixes #129
Addresses #110, #84

Bug fix

How Has This Been Tested?

$ pytest tests/registry_test.py::RegistryTest::test_hf_style_model_id_patterns -v
$ python -c "import langextract as lx; from langextract.data import ExampleData, Extraction; lx.extract(text_or_documents='Test', model_id='gemma2:2b', examples=[ExampleData(text='x', extractions=[Extraction('test', 'x')])])"

Checklist:

  • I have read and acknowledged Google's Open Source Code of conduct.
  • I have read the Contributing page, and I either signed the Google Individual CLA or am covered by my company's Corporate CLA.
  • I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach.
  • I have made any needed documentation changes, or noted in the linked issue(s) that documentation elsewhere needs updating.
  • I have added tests, or I have ensured existing tests cover the changes
  • I have followed Google's Python Style Guide and ran pylint over the affected code.

- Add HF-style patterns (e.g., meta-llama/Llama-3.2-1B-Instruct) to Ollama registry
- Add gpt-oss pattern to support issue #116
- Add comprehensive documentation for using Ollama with extract()
- Include example for direct provider instantiation when ID conflicts exist
- Add test coverage for HF-style model ID patterns
@github-actions github-actions bot added the size/S Pull request with 50-150 lines changed label Aug 13, 2025
@aksg87 aksg87 self-assigned this Aug 13, 2025
@aksg87 aksg87 merged commit 50ba182 into main Aug 13, 2025
16 checks passed
aksg87 added a commit that referenced this pull request Aug 21, 2025
- Add HF-style patterns (e.g., meta-llama/Llama-3.2-1B-Instruct) to Ollama registry
- Add gpt-oss pattern to support issue #116
- Add comprehensive documentation for using Ollama with extract()
- Include example for direct provider instantiation when ID conflicts exist
- Add test coverage for HF-style model ID patterns
sinnaj pushed a commit to sinnaj/langextract that referenced this pull request Sep 3, 2025
- Add HF-style patterns (e.g., meta-llama/Llama-3.2-1B-Instruct) to Ollama registry
- Add gpt-oss pattern to support issue google#116
- Add comprehensive documentation for using Ollama with extract()
- Include example for direct provider instantiation when ID conflicts exist
- Add test coverage for HF-style model ID patterns
aksg87 added a commit that referenced this pull request Sep 12, 2025
- Add HF-style patterns (e.g., meta-llama/Llama-3.2-1B-Instruct) to Ollama registry
- Add gpt-oss pattern to support issue #116
- Add comprehensive documentation for using Ollama with extract()
- Include example for direct provider instantiation when ID conflicts exist
- Add test coverage for HF-style model ID patterns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Pull request with 50-150 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API key still required for Ollama

1 participant