Skip to content
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

Ollama compatibility #8

Open
MoreColors123 opened this issue Sep 9, 2024 · 5 comments
Open

Ollama compatibility #8

MoreColors123 opened this issue Sep 9, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@MoreColors123
Copy link

Judging from the videos and docs this is a great plugin which i will surely use in some way (didn't actually use it yet). I'm a heavy indesign user, and the possibilities for amending content seems incredible.

But I wonder how hard it would be to modify it so the user is able to connect the plugin to a locally running ollama server and therefore make it work with locally run llm models like metas llama 3.1, mistral, etc. This would mean free use for the user.

Do you think that is doable? I don't have any experience with coding for adobe (and actually neither with any other programming language at all :-)

@RolandDreger
Copy link
Owner

In principle, that would be possible. But UXP, Adobe's scripting platform, doesn't really play along yet. So far I have only been able to get a simple text model to work. Let's see, maybe after the next update of UXP I'll have time to try it out again.

@RolandDreger RolandDreger added the enhancement New feature or request label Sep 10, 2024
@MoreColors123
Copy link
Author

Ok i see, thank you for the fast response. I'm looking forward to make this work and made a post about this idea on reddit too, just so you know: https://www.reddit.com/r/indesign/comments/1fdrsac/using_aillms_with_indesign_via_chatgpt_plugin

In the meantime I will test this great plugin in its current form! :-)

@MoreColors123
Copy link
Author

MoreColors123 commented Nov 22, 2024

Hi there, I'm still thinking about this because it has so many opportunities.

Let me tell you about my idea of working with that: Last week I "crafted" a ChatGPT prompt which converts a provided magazine article text into a tagged version based on certain rules and conditions. ChatGPT scans a text, puts a tag like (headline), (intro) or (bodytext) in front of it and returns the tagged text. Then I also wrote an Indesign script (with ChatGPT...) which replaces the tags and applies the styles. Simple search and replace with grep. No need for manual formatting of Headlines, Intros, Body text... at all.

The procedure is:

  • Copy from Word to Indesign
  • Send with prompt to ChatGPT (or Ollama) via the Plugin and reinsert text,
  • Run Script, et voilá!

While it's working pretty good, it would need more time and testing. I'm aware of the built in Style Packs feature, but it is buggy and not really good. However, that is entirely possible on locally run LLMs too, using Ollama. (Qwen2.5 and Llama3.2, for example). I've been thinking about taking your code and adapt it for Ollama usage, but don't know there to begin at all. If you want to take a look at it again, maybe this link helps? https://ollama.com/blog/openai-compatibility

Mind to share what you think about this use case?

@RolandDreger
Copy link
Owner

Thanks for sharing your use case. I also think that AI can be extremely helpful in the semantic tagging of unstructured texts. I have already thought about this when importing Word documents directly. In any case, there is a need for it. I haven't tried the Adobe feature myself yet.

Eugen Pflueger are currently developing a plugin called »Mate«. With this plugin, more interactions with Indesign should be possible directly via script. I'm not sure, but I think he is also planning different/local? ones.

With the last update, UXP has made it easier to integrate functions/APIs that are not directly supported. But the question of performance still remains. I'll find the time to test it sometime ... hopefully.

For your own experiments: UXP webview element and e.g. Transformers.js or TensorFlow,js

@MoreColors123
Copy link
Author

Thank you for your response and your tip regarding Mate. Looks very interesting. A plugin like this would also be extremely helpful for InDesign. Of course, using the OpenAI API isn’t prohibitively expensive, but it would be preferable to use a local model. Offices would likely prefer an in-house model, especially due to data protection concerns.

Thanks for the tips. I’ll have to take a look, but I think my coding skills are probably too limited to achieve a good result here.

Yes, if only we had more time—there’s so much to explore that could advance our professional lives. But then, there’s also personal life to consider…

(BTW. I just noticed that "<" and ">" were omitted, so I replaced them with "(" and ")". But it seems you understood anyway.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants