-
Notifications
You must be signed in to change notification settings - Fork 271
Add support for llama-stack #1413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |||||||||||||||||
| from urllib.parse import urlparse | ||||||||||||||||||
|
|
||||||||||||||||||
| from ramalama.common import rm_until_substring | ||||||||||||||||||
| from ramalama.config import CONFIG | ||||||||||||||||||
| from ramalama.huggingface import Huggingface | ||||||||||||||||||
| from ramalama.model import MODEL_TYPES, SPLIT_MODEL_RE, is_split_file_model | ||||||||||||||||||
| from ramalama.model_store import GlobalModelStore, ModelStore | ||||||||||||||||||
|
|
@@ -148,3 +149,20 @@ def create_url(self) -> URL: | |||||||||||||||||
| model.split_model = self.split_model | ||||||||||||||||||
| model.mnt_path = self.mnt_path | ||||||||||||||||||
| return model | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| def New(name, args, transport=CONFIG["transport"]): | ||||||||||||||||||
| return ModelFactory(name, args, transport=transport).create() | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| def Serve(name, args): | ||||||||||||||||||
| model = New(name, args) | ||||||||||||||||||
| try: | ||||||||||||||||||
| model.serve(args) | ||||||||||||||||||
| except KeyError as e: | ||||||||||||||||||
| try: | ||||||||||||||||||
| args.quiet = True | ||||||||||||||||||
| model = ModelFactory(name, args, ignore_stderr=True).create_oci() | ||||||||||||||||||
| model.serve(args) | ||||||||||||||||||
| except Exception: | ||||||||||||||||||
| raise e | ||||||||||||||||||
|
Comment on lines
+167
to
+168
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (code-quality): Explicitly raise from a previous error (
Suggested change
Comment on lines
+167
to
+168
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (code-quality): Explicitly raise from a previous error (
Suggested change
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Parsing
docker portoutput by splitting on '>' is brittleThis breaks if Docker/Podman returns multiple mappings or uses a different format. Use a regex or
docker port --formatstructured output for more reliable parsing.